1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-10-31 00:07:48 +02:00

Chore: Trying to improve flaky test

This commit is contained in:
Laurent Cozic
2023-12-05 18:53:32 +00:00
parent 474365188d
commit 2c0f8d5c6b

View File

@@ -456,14 +456,15 @@ describe('services/RevisionService', () => {
await Note.save({ id: n1_v0.id, title: 'hello' });
await revisionService().collectRevisions(); // REV 1
const timeRev1 = Date.now();
await msleep(200);
const sleepTime = 500;
await msleep(sleepTime);
const timeRev2 = Date.now();
await Note.save({ id: n1_v0.id, title: 'hello 2' });
await revisionService().collectRevisions(); // REV 2
expect((await Revision.all()).length).toBe(2);
const interval = Date.now() - timeRev1 + 1;
const interval = Date.now() - timeRev1 + sleepTime / 2;
Setting.setValue('revisionService.intervalBetweenRevisions', interval);
await Note.save({ id: n1_v0.id, title: 'hello 3' });