Files
node/test/fixtures
Shelley Vohr 31f4bd73b2 test: make node:bench test samples survive a coarse clock
Most node:bench tests record a sample with `b.start();
process.hrtime.bigint(); b.end(1)`, counting on the extra clock read to
make end() see a later timestamp than start(). On a debian12-x64 CI
host the monotonic clock is coarse enough that all three reads returned
the same value, so end() threw ERR_INVALID_STATE ("insufficient clock
precision for benchmark sample") and test-bench-harness-errors failed;
every test using the idiom can fail the same way there.

Add test/common/bench.js with completeSample(), which spins until
process.hrtime.bigint() moves between start() and end(), and use it at
all of those sites, bench-runner fixtures included.

Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65780
Fixes: https://github.com/nodejs/node/issues/64226
Refs: https://github.com/nodejs/node/issues/59146
Refs: https://github.com/nodejs/node/issues/54534
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2026-09-15 10:49:40 +02:00
..
…
2026-01-11 18:05:01 +00:00
2026-09-15 10:49:35 +02:00
2026-09-15 10:49:17 +02:00
…
2025-09-22 18:12:43 -07:00
2023-08-21 16:41:53 +00:00
2026-09-15 10:49:22 +02:00
…
…
…
…
…
…
…
…
…
…
2025-02-08 12:43:53 +00:00
…
…
…
…
2022-08-29 11:39:15 +08:00
2026-07-29 10:31:34 -03:00
…
…