Skip to content

test: deflake test-process-timeout-blocked - #67481

Open
christianaurichzm wants to merge 1 commit into
nodejs:mainfrom
christianaurichzm:deflake-process-timeout-blocked
Open

christianaurichzm wants to merge 1 commit into
nodejs:mainfrom
christianaurichzm:deflake-process-timeout-blocked

Conversation

@christianaurichzm

Copy link
Copy Markdown
Member

test-process-timeout-blocked fails intermittently on the Windows 11 arm64 machines when, in the throw/reject cases, the 1000 ms deadline expires while the main thread is still formatting the uncaught error. The main thread then handles the timeout itself, so the expected message is not printed.

The fixtures that exit create their ready file in an 'exit' listener, which runs before the error is formatted, so the test did not retry. The main thread cannot handle the timeout once the process is exiting, so the test now retries when it did, and those fixtures no longer create the file. The assertions are unchanged.

With the first timeout lowered to 56-90 ms, where that formatting happens on x64, main fails 8/490 runs, all with the CI output, and this change 0/490. Unmodified, the test passes 300/300 with tools/test.py -j12 --repeat=300.

Refs: nodejs/reliability#1724

The fixtures that exit while a Worker is blocked created their file in
an 'exit' listener, before the process actually starts exiting, e.g.
while an uncaught error is still being formatted. If the deadline
expired in between, the main thread handled the timeout and the test
failed instead of retrying. The main thread cannot do that once it is
exiting, so retry when it did, and drop the 'exit' listeners.

Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.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 15, 2026
@christianaurichzm christianaurichzm added the flaky-test Issues and PRs involving tests that fail intermittently in CI. label Nov 15, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Nov 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.66%. Comparing base (c07db8c) to head (4f58e0c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67481      +/-   ##
==========================================
- Coverage   90.67%   90.66%   -0.02%     
==========================================
  Files         799      799              
  Lines      280246   280246              
  Branches    54124    54111      -13     
==========================================
- Hits       254125   254076      -49     
- Misses      16241    16294      +53     
+ Partials     9880     9876       -4     

see 29 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.

@aduh95

aduh95 commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Doesn't that change what's being tested?

@christianaurichzm

Copy link
Copy Markdown
Member Author

It shouldn't. The fixtures still exit the same way with the Worker blocked, and the asserts are the same. The 'exit' listeners only wrote the ready file, and they wrote it too early.

I first tried keeping them and checking stderr in the test instead, but then blocked-worker.js never counts as ready, since its main thread always handles the timeout. A real failure there would only show up on the last attempt, or pass on a retry if it's intermittent.

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.

4 participants