test: avoid timer race in event loop delay test - #64728
Open
trivikr wants to merge 1 commit into
Open
Conversation
Member
Author
|
Stress tests on |
trivikr
marked this pull request as ready for review
July 25, 2026 21:40
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #64728 +/- ##
==========================================
- Coverage 90.32% 90.32% -0.01%
==========================================
Files 760 760
Lines 249130 249130
Branches 47041 47041
==========================================
- Hits 225030 225023 -7
- Misses 15490 15494 +4
- Partials 8610 8613 +3 🚀 New features to boost your workflow:
|
An expired timer can run before the first complete event loop iteration, disabling the histogram before it records any samples. Drive a known number of iterations with setImmediate before checking the histograms, and share the chain between resolution variants. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: codex:gpt-5.6-sol
trivikr
force-pushed
the
test-performance-eventloopdelay
branch
from
August 12, 2026 15:49
c040df1 to
f862517
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs: https://github.com/nodejs/reliability/issues?q=sort%3Aupdated-desc%20test-performance-eventloopdelay
Problem
The test enables the histogram and checks it from a 20 ms timer.
On slow or contended systems, that timer can expire before the first complete event loop iteration.
The timer then disables the histogram before its
uv_checkcallback records a sample.Previous fixes addressed related but distinct failures:
The failing
samplePerIterationchecks were added later by #62935 and still depend on elapsed time.Solution
Drive a known number of event loop iterations using
setImmediatebefore disabling and checking each histogram.The default-resolution and large-resolution checks share one iteration chain, removing the duplicated timing logic.
Assisted-by: codex:gpt-5.6-sol