test: add retry logic for eventloopdelay histogram sampling#61796
Open
mcollina wants to merge 1 commit intonodejs:mainfrom
Open
test: add retry logic for eventloopdelay histogram sampling#61796mcollina wants to merge 1 commit intonodejs:mainfrom
mcollina wants to merge 1 commit intonodejs:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61796 +/- ##
==========================================
- Coverage 89.76% 89.74% -0.02%
==========================================
Files 675 675
Lines 204674 204674
Branches 39330 39325 -5
==========================================
- Hits 183716 183689 -27
- Misses 13235 13252 +17
- Partials 7723 7733 +10 🚀 New features to boost your workflow:
|
46dd75d to
a0b9aa0
Compare
On some build configurations (e.g., sharedlibs), the histogram may not record valid samples (min > 0) after the initial spinning period. This adds a retry mechanism that will spin the event loop additional times if valid samples haven't been recorded yet. This helps ensure the test passes on slower or differently-configured systems where event loop delay sampling may take longer to produce measurable results. Refs: nodejs/reliability#1461
a0b9aa0 to
ad1c0a7
Compare
jasnell
approved these changes
Feb 13, 2026
cjihrig
approved these changes
Feb 13, 2026
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.
Summary
Fixes flaky
test-performance-eventloopdelaytest on sharedlibs builds.Problem
On some build configurations (e.g., Ubuntu 24.04 sharedlibs), the histogram may not record valid samples (
min > 0) after the initial spinning period. The test fails with:The previous fix (PR #61629) added
setImmediateto allow samples to be recorded, but this wasn't sufficient for all configurations.Solution
Add a retry mechanism that checks if valid samples have been recorded (
count > 0 && min > 0 && max > 0). If not, the test will spin the event loop additional times (up to 3 retries) before asserting.This ensures the test passes on slower or differently-configured systems where event loop delay sampling may take longer to produce measurable results.
Verification
Tested locally with
python3 tools/test.py --repeat 30- all passed.Refs: nodejs/reliability#1461