Skip to content

test: deflake test-perf-hooks.js

Previously when checking the initial timing we did a lot of checks after accessing and copying timing.duration and before we check that timing.duration is roughly the same as performance.now(), which can lead to flakes if the overhead of the checking is big enough. Update the test to check timing.duration against performance.now() as soon as possible when it's copied instead of computed.

Refs: https://github.com/nodejs/reliability/issues/676

Merge request reports

Loading