Skip to content

Commit cc6fda6

Browse files
webzwo0irhansen
authored andcommitted
adminsettings test: Fix restart detection
We cannot guarantee that the system time on SauceLabs and Github is in sync. In case the SauceLabs runner's clock is slow the test would have failed.
1 parent d262e31 commit cc6fda6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tests/frontend/specs/adminsettings.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ describe('Admin > Settings', function () {
6969
return null;
7070
}
7171
};
72+
let oldStartTime;
7273
await helper.waitForPromise(async () => {
73-
const startTime = await getStartTime();
74-
return startTime != null && startTime > 0 && Date.now() > startTime;
74+
oldStartTime = await getStartTime();
75+
return oldStartTime != null && oldStartTime > 0;
7576
}, 1000, 500);
76-
const clickTime = Date.now();
7777
helper.admin$('#restartEtherpad').click();
7878
await helper.waitForPromise(async () => {
7979
const startTime = await getStartTime();
80-
return startTime != null && startTime >= clickTime;
80+
return startTime != null && startTime > oldStartTime;
8181
}, 60000, 500);
8282
});
8383
});

0 commit comments

Comments
 (0)