add margin of error to the test

Sometimes this is flaky on CI, even though it doesn't make any sense
because we use `setTimeout(_, 500)` which should _at least_ result in
500ms...

But sometimes this results into:
```
AssertionError: expected 499.76 to be greater than or equal to 500
```
This commit is contained in:
Robin Malfait 2026-06-25 19:23:36 +02:00
parent 38652a4638
commit 94f7907b55
No known key found for this signature in database

View file

@ -83,7 +83,7 @@ it('should measure async callbacks via the `span` api', async () => {
`)
let [, duration] = stripVTControlCharacters(output).match(/\[(.*)\]/)!
expect(parseFloat(duration)).toBeGreaterThanOrEqual(500)
expect(parseFloat(duration)).toBeGreaterThanOrEqual(500 - 2 /* Margin of error */)
})
})