mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-05 18:05:19 +02:00
[v12.0/forgejo] chore(ci): testSleep: show actual times on failures (#8277)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8271 I just experienced a spurious error on `testSleep`. The current assertion only showed `expected false to be truthy`. With this PR it should show the actual elapsed time (to be able to knowingly adjust the expected delay). Co-authored-by: oliverpool <git@olivier.pfad.fr> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8277 Reviewed-by: Beowulf <beowulf@beocode.eu> Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org> Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
parent
6d4554b01c
commit
309ddf6ec7
1 changed files with 2 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
import {expect, test} from 'vitest';
|
||||
import {
|
||||
basename, extname, isObject, stripTags, parseIssueHref,
|
||||
parseUrl, translateMonth, translateDay, blobToDataURI,
|
||||
|
@ -182,5 +183,5 @@ async function testSleep(ms) {
|
|||
await sleep(ms);
|
||||
const endTime = Date.now(); // Record the end time
|
||||
const actualSleepTime = endTime - startTime;
|
||||
expect(actualSleepTime >= ms).toBeTruthy();
|
||||
expect(actualSleepTime).toBeGreaterThanOrEqual(ms);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue