mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 10:19:08 +00:00
Fix out-of-disk-space test
This commit is contained in:
@@ -327,10 +327,13 @@ describe('AttachmentDownloadManager/JobManager', () => {
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const jobAttempts = getPromisesForAttempts(jobs[0], 2);
|
||||||
|
|
||||||
statfs.callsFake(() => Promise.resolve({ bavail: 0, bsize: 8 }));
|
statfs.callsFake(() => Promise.resolve({ bavail: 0, bsize: 8 }));
|
||||||
|
|
||||||
await downloadManager?.start();
|
await downloadManager?.start();
|
||||||
await advanceTime(2 * MINUTE);
|
await jobAttempts[0].completed;
|
||||||
|
|
||||||
assert.strictEqual(runJob.callCount, 0);
|
assert.strictEqual(runJob.callCount, 0);
|
||||||
assert.strictEqual(onLowDiskSpaceBackupImport.callCount, 1);
|
assert.strictEqual(onLowDiskSpaceBackupImport.callCount, 1);
|
||||||
assert.isTrue(window.storage.get('backupMediaDownloadPaused'));
|
assert.isTrue(window.storage.get('backupMediaDownloadPaused'));
|
||||||
@@ -338,12 +341,11 @@ describe('AttachmentDownloadManager/JobManager', () => {
|
|||||||
statfs.callsFake(() =>
|
statfs.callsFake(() =>
|
||||||
Promise.resolve({ bavail: 100_000_000_000, bsize: 8 })
|
Promise.resolve({ bavail: 100_000_000_000, bsize: 8 })
|
||||||
);
|
);
|
||||||
|
|
||||||
const job0Attempts = getPromisesForAttempts(jobs[0], 1)[0];
|
|
||||||
await window.storage.put('backupMediaDownloadPaused', false);
|
await window.storage.put('backupMediaDownloadPaused', false);
|
||||||
|
|
||||||
await advanceTime(2 * MINUTE);
|
await advanceTime(2 * MINUTE);
|
||||||
assert.strictEqual(runJob.callCount, 1);
|
assert.strictEqual(runJob.callCount, 1);
|
||||||
await job0Attempts.started;
|
await jobAttempts[1].completed;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handles retries for failed', async () => {
|
it('handles retries for failed', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user