-
Notifications
You must be signed in to change notification settings - Fork 13.3k
libtest: Wait for test threads to exit after they report completion #81367
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
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 <andersk@mit.edu>
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 <andersk@mit.edu>
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 <andersk@mit.edu>
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 <andersk@mit.edu> (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.)