test: avoid timer race in event loop delay test - #64728
Merged
Merged
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 91.85% 90.15% -1.71%
==========================================
Files 400 752 +352
Lines 178855 251884 +73029
Branches 27331 47368 +20037
==========================================
+ Hits 164292 227078 +62786
- Misses 14234 16164 +1930
- Partials 329 8642 +8313 🚀 New features to boost your workflow:
|
trivikr
force-pushed
the
test-performance-eventloopdelay
branch
from
August 12, 2026 15:49
c040df1 to
f862517
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Member
Both of these are passing stress tests over |
panva
approved these changes
Aug 17, 2026
panva
left a comment
Member
There was a problem hiding this comment.
LGTM but please stress test the PR head.
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
|
Stress test on PR: https://ci.nodejs.org/job/node-stress-single-test/837/ |
This comment was marked as outdated.
This comment was marked as outdated.
Collaborator
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 PR-URL: nodejs#64728 Refs: https://github.com/nodejs/reliability/issues?q=sort%3Aupdated-desc%20test-performance-eventloopdelay Reviewed-By: Filip Skokan <panva.ip@gmail.com>
trivikr
force-pushed
the
test-performance-eventloopdelay
branch
from
August 18, 2026 00:21
f862517 to
92ee8b7
Compare
Member
Author
|
Landed in 92ee8b7 |
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