-
-
Notifications
You must be signed in to change notification settings - Fork 14
feat: show relevant running tests when worker unexpectedly exited #722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this 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 enhances error diagnostics by displaying relevant running tests when a worker unexpectedly exits during test execution. The implementation centralizes test state management by moving tracking logic from StatusRenderer to a new TestStateManager class, making the running test information available during error handling to provide better troubleshooting context.
- Introduces
RstestTestStateinterface to expose running test information via getter methods - Refactors state tracking from
StatusRendererinto centralizedTestStateManagerwith support for tracking both running tests and completed results - Enhances error messages when workers exit unexpectedly by appending information about which tests were running at the time of failure
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/types/core.ts | Adds RunningModules and RstestTestState types to expose test state information |
| packages/core/src/core/stateManager.ts | Expands state tracking to include running tests in addition to results, adds onTestCaseStart method |
| packages/core/src/reporter/statusRenderer.ts | Refactors to use shared RstestTestState instead of managing its own state, simplifies method signatures |
| packages/core/src/reporter/index.ts | Updates constructor to accept and pass testState to StatusRenderer |
| packages/core/src/pool/index.ts | Adds error handling logic to display running tests when worker exits unexpectedly |
| packages/core/src/core/rstest.ts | Initializes testState object and passes it to reporters |
Comments suppressed due to low confidence (1)
packages/core/src/pool/index.ts:340
- The fallback error handling (lines 332-340) doesn't use
runningModule?.resultslike the Error instance handling does on line 327. For consistency and to preserve test results when a non-Error is thrown, consider usingrunningModule?.results || []here as well (whererunningModulewould need to be captured outside theif (err instanceof Error)block).
return {
testId: '0',
project: projectName,
testPath: entryInfo.testPath,
status: 'fail',
name: '',
results: [],
errors: [err],
} as TestFileResult;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Summary
support show relevant running tests when worker unexpectedly exited.
This will be helpful in troubleshooting issues when
worker unexpectedly exitedduring testing, such as Rust panic in rspack tests.before:

after:

Related Links
Checklist