Skip to content

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Nov 27, 2025

Summary

support show relevant running tests when worker unexpectedly exited.
This will be helpful in troubleshooting issues when worker unexpectedly exited during testing, such as Rust panic in rspack tests.

before:
img_v3_02se_b74ee932-7080-4068-b91e-391e7f5aaebg

after:
image

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings November 27, 2025 11:44
@netlify
Copy link

netlify bot commented Nov 27, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit e82c090
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/69283c4449b41400081e1a54
😎 Deploy Preview https://deploy-preview-722--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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 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 RstestTestState interface to expose running test information via getter methods
  • Refactors state tracking from StatusRenderer into centralized TestStateManager with 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?.results like the Error instance handling does on line 327. For consistency and to preserve test results when a non-Error is thrown, consider using runningModule?.results || [] here as well (where runningModule would need to be captured outside the if (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.

@9aoy 9aoy changed the title feat: support show relevant running tests when worker unexpectedly exited feat: show relevant running tests when worker unexpectedly exited Nov 27, 2025
@9aoy 9aoy merged commit 28cd856 into main Nov 28, 2025
18 checks passed
@9aoy 9aoy deleted the show-relevant-case branch November 28, 2025 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants