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.
pull/5119/head
webzwo0i 2021-07-16 20:46:04 +02:00 committed by Richard Hansen
parent d262e31bbf
commit cc6fda6916
1 changed files with 4 additions and 4 deletions

View File

@ -69,15 +69,15 @@ describe('Admin > Settings', function () {
return null;
}
};
let oldStartTime;
await helper.waitForPromise(async () => {
const startTime = await getStartTime();
return startTime != null && startTime > 0 && Date.now() > startTime;
oldStartTime = await getStartTime();
return oldStartTime != null && oldStartTime > 0;
}, 1000, 500);
const clickTime = Date.now();
helper.admin$('#restartEtherpad').click();
await helper.waitForPromise(async () => {
const startTime = await getStartTime();
return startTime != null && startTime >= clickTime;
return startTime != null && startTime > oldStartTime;
}, 60000, 500);
});
});