-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libtest: Wait for test threads to exit after they report completion #81367
Conversation
Otherwise we can miss bugs where a test reports that it succeeded but then panics within a TLS destructor. Signed-off-by: Anders Kaseorg <[email protected]>
r? @dtolnay (rust-highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is great.
@bors r+ |
📌 Commit 57c72ab has been approved by |
failed in #81385 (comment) @bors r- rollup=iffy |
I guess that could happen if a test returns after timing out. Will fix. |
This reduces the total complexity of checking timeouts from quadratic to linear, and should also fix an unwrap of None on completion of an already timed-out test. Signed-off-by: Anders Kaseorg <[email protected]>
aa2822c
to
b05788e
Compare
@bors r+ |
📌 Commit b05788e has been approved by |
☀️ Test successful - checks-actions |
It is possible for different tests to collide to the same TestDesc when macros are involved. That is a bug, but it didn’t cause a panic until rust-lang#81367. For now, change the code to ignore this problem. Fixes rust-lang#81852. Signed-off-by: Anders Kaseorg <[email protected]>
libtest: Fix unwrap panic on duplicate TestDesc It is possible for different tests to collide to the same `TestDesc` when macros are involved. That is a bug, but it didn’t cause a panic until rust-lang#81367. For now, change the code to ignore this problem. Fixes rust-lang#81852. This will need to be applied to `beta` too.
It is possible for different tests to collide to the same TestDesc when macros are involved. That is a bug, but it didn’t cause a panic until rust-lang#81367. For now, change the code to ignore this problem. Fixes rust-lang#81852. Signed-off-by: Anders Kaseorg <[email protected]> (cherry picked from commit 1605af0)
Otherwise we can miss bugs where a test reports that it succeeded but then panics within a TLS destructor.
Example:
Before this fix,
cargo test
incorrectly reports success.After this fix, the failure is visible. (The entire process is aborted due to #24479.)