Skip to content

test: can not handle uncaughtException correctly#12179

Merged
9aoy merged 2 commits intomainfrom
test/uncaughtException
Nov 13, 2025
Merged

test: can not handle uncaughtException correctly#12179
9aoy merged 2 commits intomainfrom
test/uncaughtException

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Nov 13, 2025

Summary

fix: uncaughtException was not being handled correctly in tests because all uncaughtException listeners were removed.

before:
img_v3_02rv_de1c635f-2551-4f8c-a914-33e08cf074dg

img_v3_02rv_778bb80d-3bd3-4c02-9d85-cb526f84c3eg

after:
img_v3_02rv_2bfe2173-4a35-446b-b60e-9c053d587c4g

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings November 13, 2025 03:34
@9aoy 9aoy requested a review from LingyuCoder as a code owner November 13, 2025 03:34
@netlify
Copy link

netlify bot commented Nov 13, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 65bae16
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6915546aab44860008229f82

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Nov 13, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where uncaughtException and unhandledRejection events were not being handled correctly in tests. The previous implementation removed all listeners for these events, which broke proper error handling. The fix targets only the specific listeners added by the wast-loader package by removing just the last listener for each event type.

Key Changes:

  • Replaced process.removeAllListeners() calls with selective removal of the last listener for uncaughtException and unhandledRejection events
  • Preserves other error handling listeners that may be registered by the test framework or other components

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 65bae16 to chore(ci): revert cache action version (#12170) by pshu

🙈 Size remains the same at 48.10MB

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 13, 2025

CodSpeed Performance Report

Merging #12179 will not alter performance

Comparing test/uncaughtException (65bae16) with main (91fb897)

Summary

✅ 17 untouched

@9aoy 9aoy enabled auto-merge (squash) November 13, 2025 04:07
@9aoy 9aoy merged commit fbd97f0 into main Nov 13, 2025
44 checks passed
@9aoy 9aoy deleted the test/uncaughtException branch November 13, 2025 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants