mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 01:16:15 -04:00
express: Change httpUptime
to httpStartTime
(#4777)
It's better to provide a primitive value and let the consumer of the metric do math if desired. Co-authored-by: John McLear <john@mclear.co.uk>
This commit is contained in:
parent
13a0b0688f
commit
e674d9789e
3 changed files with 14 additions and 12 deletions
|
@ -56,28 +56,28 @@ describe('Admin > Settings', function () {
|
|||
|
||||
it('restart works', async function () {
|
||||
this.timeout(60000);
|
||||
const getUptime = async () => {
|
||||
const getStartTime = async () => {
|
||||
try {
|
||||
const {httpUptime} = await $.ajax({
|
||||
const {httpStartTime} = await $.ajax({
|
||||
url: new URL('/stats', window.location.href),
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
timeout: 450, // Slightly less than the waitForPromise() interval.
|
||||
});
|
||||
return httpUptime;
|
||||
return httpStartTime;
|
||||
} catch (err) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
await helper.waitForPromise(async () => {
|
||||
const uptime = await getUptime();
|
||||
return uptime != null && uptime > 0;
|
||||
const startTime = await getStartTime();
|
||||
return startTime != null && startTime > 0 && Date.now() > startTime;
|
||||
}, 1000, 500);
|
||||
const clickTime = Date.now();
|
||||
helper.admin$('#restartEtherpad').click();
|
||||
await helper.waitForPromise(async () => {
|
||||
const uptime = await getUptime();
|
||||
return uptime != null && Date.now() - uptime >= clickTime;
|
||||
const startTime = await getStartTime();
|
||||
return startTime != null && startTime >= clickTime;
|
||||
}, 60000, 500);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue