Skip to content

fix: don't re-throw in jsdom-svg-polyfill uncaughtException handler - #4999

Merged
aglinxinyuan merged 1 commit into
apache:mainfrom
Ma77Ball:fix/polyfillRethrowError
May 9, 2026
Merged

aglinxinyuan merged 1 commit into
apache:mainfrom
Ma77Ball:fix/polyfillRethrowError

Conversation

@Ma77Ball

@Ma77Ball Ma77Ball commented May 9, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Replace the throw err / throw reason inside the process.on("uncaughtException") and process.on("unhandledRejection") handlers in frontend/src/jsdom-svg-polyfill.ts with console.error(...).

Re-throwing in uncaughtException aborts the Node process, crashing the Vitest worker mid-run and leaving the runner hanging until the CI timeout. Logging instead lets Vitest's own error handling fail the offending spec
without killing sibling tests in the same worker.

Any related issues, documentation, or discussions?

Closes: #4998

How was this PR tested?

Ran yarn ng test --watch=false locally — full suite passes cleanly. CI runs on the branch that no longer hangs.

Was this PR authored or co-authored using generative AI tooling?

Discovered with Claude Opus 4.7 in compliance with ASF

@github-actions github-actions Bot added fix frontend Changes related to the frontend GUI labels May 9, 2026
@Ma77Ball

Ma77Ball commented May 9, 2026 •

Copy link
Copy Markdown
Contributor Author

@Ma77Ball

Ma77Ball commented May 9, 2026

Copy link
Copy Markdown
Contributor Author

After running the frontend test 3 times, I found the control got caught on the same error while the test/fix experienced no errors.

@Ma77Ball

Ma77Ball commented May 9, 2026

Copy link
Copy Markdown
Contributor Author

/request-review @aglinxinyuan

@github-actions
github-actions Bot requested a review from aglinxinyuan May 9, 2026 08:31
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.72%. Comparing base (75ff07e) to head (37742cd).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #4999   +/-   ##
=========================================
  Coverage     42.72%   42.72%           
  Complexity     2186     2186           
=========================================
  Files          1031     1031           
  Lines         38152    38152           
  Branches       4004     4004           
=========================================
  Hits          16302    16302           
  Misses        20831    20831           
  Partials       1019     1019           
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø) Carriedforward from 75ff07e
agent-service 33.72% <ø> (ø) Carriedforward from 75ff07e
amber 43.22% <ø> (ø) Carriedforward from 75ff07e
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from 75ff07e
config-service 0.00% <ø> (ø) Carriedforward from 75ff07e
file-service 32.18% <ø> (ø) Carriedforward from 75ff07e
frontend 33.08% <ø> (ø)
python 88.90% <ø> (ø) Carriedforward from 75ff07e
workflow-compiling-service 47.72% <ø> (ø) Carriedforward from 75ff07e

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@aglinxinyuan
aglinxinyuan merged commit 6f088ab into apache:main May 9, 2026
18 checks passed
@Yicong-Huang

Copy link
Copy Markdown
Contributor

Thanks for the fix!

yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
…pache#4999)

### What changes were proposed in this PR?
Replace the `throw err` / `throw reason` inside the
`process.on("uncaughtException")` and `process.on("unhandledRejection")`
handlers in `frontend/src/jsdom-svg-polyfill.ts` with
`console.error(...)`.
  
Re-throwing in `uncaughtException` aborts the Node process, crashing the
Vitest worker mid-run and leaving the runner hanging until the CI
timeout. Logging instead lets Vitest's own error handling fail the
offending spec
  without killing sibling tests in the same worker.

### Any related issues, documentation, or discussions?
Closes: apache#4998
### How was this PR tested?
Ran `yarn ng test --watch=false` locally — full suite passes cleanly. CI
runs on the branch that no longer hangs.

### Was this PR authored or co-authored using generative AI tooling?
Discovered with Claude Opus 4.7 in compliance with ASF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI test runner hangs when Zone-leaked errors hit jsdom-svg-polyfill uncaughtException handler

4 participants