mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
4d2f9ca08d
stream_send_recv_stress tests: wait for threads to finish 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.