Skip to content

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Sep 11, 2025

Instead of creating, starting and tearing down the worker for each test module, we can create it once, start it once for the full test suite and then tear it down at the end of the test suite. This also ensures that we don't accidentally perform network calls in tests that didn't explicitly set up MSW.

Additionally, this might fix the flakiness we've been seeing with the test suite when run on the CI runners, and is generally recommended by the MSW devs.

This PR should also unblock #11876

Instead of creating, starting and tearing down the worker for each test module, we can create it once, start it once for the full test suite and then tear it down at the end of the test suite. This also ensures that we don't accidentally perform network calls in tests that didn't explicitly set up MSW.

Additionally, this might fix the flakiness we've been seeing with the test suite when run on the CI runners, and is generally recommended by the MSW devs.
@Turbo87 Turbo87 merged commit 5ed4db6 into rust-lang:main Sep 11, 2025
11 checks passed
@Turbo87 Turbo87 deleted the msw-setup branch September 11, 2025 16:25
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