Commit 12481ec
committed
fix(test-utils): Use epoch-based timestamps in event proxy server
The timestamp filtering used process.hrtime() which returns time relative
to an arbitrary process-local reference point. Since the event proxy
server and Playwright test runner are separate Node.js processes, their
hrtime values were not comparable.
This caused waitForTransaction() to sometimes match transactions from
previous tests (stale events leaking from the buffer), leading to flaky
test failures like the react-router-7-lazy-routes duration assertion.
Fix: Use Date.now() (epoch milliseconds) plus a sub-millisecond component
from performance.now() to get high-resolution timestamps that are
comparable across processes.1 parent d62b54e commit 12481ec
1 file changed
+17
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
414 | 423 | | |
415 | 424 | | |
416 | | - | |
417 | | - | |
418 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
419 | 432 | | |
0 commit comments