Skip to content

test: ignore late worker exceptions in WPT runner#63106

Open
marcopiraccini wants to merge 1 commit intonodejs:mainfrom
marcopiraccini:wpt-fixture-bug
Open

test: ignore late worker exceptions in WPT runner#63106
marcopiraccini wants to merge 1 commit intonodejs:mainfrom
marcopiraccini:wpt-fixture-bug

Conversation

@marcopiraccini
Copy link
Copy Markdown
Contributor

Problem

WPT semantics: once done() is called the test result is final. Browsers send any later exception to window.onerror and do not fail the test. Node's WPT worker forwarded post-completion uncaughtExceptions to the parent as Worker 'error' events, which the runner reports as failures.

Affected flaky tests:

  • wpt/test-timershtml/webappapis/timers/type-long-settimeout.any.js
  • wpt/test-timershtml/webappapis/timers/type-long-setinterval.any.js

Fix

Install a no-op uncaughtException handler from inside add_completion_callback, before posting completion. Late exceptions in the worker are then swallowed, matching browser semantics. Scope is one fixture per worker (one Worker per spec), so it cannot leak into other tests.

Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels May 4, 2026
@marcopiraccini marcopiraccini marked this pull request as ready for review May 4, 2026 03:36
@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.67%. Comparing base (b2f6aa3) to head (fa4c14d).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63106      +/-   ##
==========================================
+ Coverage   89.65%   89.67%   +0.02%     
==========================================
  Files         712      712              
  Lines      220512   220822     +310     
  Branches    42289    42385      +96     
==========================================
+ Hits       197690   198019     +329     
+ Misses      14663    14613      -50     
- Partials     8159     8190      +31     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants