Skip to content

Conversation

@AriPerkkio
Copy link
Member

Description

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link
Member Author

@AriPerkkio AriPerkkio left a comment

Choose a reason for hiding this comment

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

Ideally this would be done after these 3 cleanups but not sure if there was some reason why it can't be done there..?

finally {
await rpcDone().catch(() => {})
await Promise.all(cleanups.map(fn => fn())).catch(() => {})
await environmentLoader?.close()
}

The rpcDone should ensure rpc is, well, done.

@sheremet-va
Copy link
Member

Ideally this would be done after these 3 cleanups but not sure if there was some reason why it can't be done there..?

Because there could be async processes that use the RPC (like fetch) started in tests. Closing the RPC hangs the process in these situations.

@AriPerkkio
Copy link
Member Author

I wonder if that issue would come up in isolate: false too. The fetch started by previous test starts running when second test file is running. 🤔

@AriPerkkio AriPerkkio merged commit 573dc06 into vitest-dev:main Oct 26, 2025
16 of 24 checks passed
@AriPerkkio AriPerkkio deleted the fix/workers-rpc-listeners-leak branch October 26, 2025 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants