Skip to content

stream_send_recv_stress tests: wait for threads to finish#156365

Open
RalfJung wants to merge 1 commit intorust-lang:mainfrom
RalfJung:stream_send_recv_stress
Open

stream_send_recv_stress tests: wait for threads to finish#156365
RalfJung wants to merge 1 commit intorust-lang:mainfrom
RalfJung:stream_send_recv_stress

Conversation

@RalfJung
Copy link
Copy Markdown
Member

@RalfJung RalfJung commented May 9, 2026

These tests currently fail in Miri (when run with nextest) because all they do is spawn a lot of threads that will do stuff, but they don't wait for the threads to actually finish. Miri by default errors when there are background threads lingering when main is done (since that can indicate a leak, and since it makes it impossible to check for memory leaks). Miri gives background threads a bit of time to finish when main is done, but for these tests that's nowhere near enough since basically the entire test runs after main is done.

Outside Miri, this could also still mean that the test doesn't actually run to completion, it might get abort when main finishes.

So let's use thread::scope to ensure all threads are done before the test is considered done.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 9, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 9, 2026

r? @nia-e

rustbot has assigned @nia-e.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, nia-e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants