Commit 308bcb3
committed
fix(tests): add retry logic for flaky performance timing test
Fix flaky "should measure elapsed time" test that was failing due to
timer imprecision. setTimeout(10) does not guarantee exactly 10ms or
more will elapse due to OS scheduling and timer resolution.
Changes:
- Lower threshold from 10ms to 9ms to account for timer imprecision
- Add retry: 3 option to automatically retry the test on failure
- Add explanatory comment about setTimeout behavior
This test was failing intermittently with elapsed times like 9.775ms,
which is less than the 10ms threshold but within normal timer variance.1 parent 5723c70 commit 308bcb3
1 file changed
Lines changed: 14 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| |||
0 commit comments