Skip to content

test: deflake test-worker-eventlooputil - #67260

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mcollina:deflake-worker-eventlooputil
Nov 8, 2026
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mcollina:deflake-worker-eventlooputil

Conversation

@mcollina

@mcollina mcollina commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

worker.performance.eventLoopUtilization() reads the worker's idle time
before the current time. If the parent thread stalls between the two
reads while the worker is idle, the stall is counted as worker active
time in the first sample and is missing from the delta, so the 50ms
spin can be reported as slightly less than 50ms:

AssertionError [ERR_ASSERTION]: 48.961083001159786 < 50
    at MessagePort.<anonymous> (test/sequential/test-worker-eventlooputil.js:104:12)

Injecting a 2ms busy-wait between the two reads reproduces it every time
(active=48.05). The test now bounds the skew by timing the first
workerELU() call.

Refs: nodejs/reliability#1482


AI Generated, reviewed by me

worker.performance.eventLoopUtilization() reads the worker's idle time
before the current time. If the parent thread stalls between the two
reads while the worker is idle, the stall is counted as worker active
time in the first sample and is missing from the delta, so the 50ms
spin can be reported as slightly less than 50ms.

Bound that skew by timing the first workerELU() call.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure. labels Nov 4, 2026
@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.66%. Comparing base (98dbf60) to head (7013ebf).
⚠️ Report is 151 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67260      +/-   ##
==========================================
+ Coverage   90.65%   90.66%   +0.01%     
==========================================
  Files         797      797              
  Lines      278268   279367    +1099     
  Branches    53517    53735     +218     
==========================================
+ Hits       252261   253291    +1030     
+ Misses      16386    16360      -26     
- Partials     9621     9716      +95     

see 68 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 8, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 8, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@panva panva added the flaky-test Issues and PRs involving tests that fail intermittently in CI. label Nov 8, 2026
@mcollina mcollina added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 8, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 768315c into nodejs:main Nov 8, 2026
88 of 89 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 768315c

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flaky-test Issues and PRs involving tests that fail intermittently in CI. needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants