Skip to content

Commit 79f962f

Browse files
committed
Auto merge of #6431 - ehuss:panic-in-panic, r=nrc
Fix panic-in-panic in tests. There are some very rare circumstances that can cause a double panic during development. For example, `.with_json("")` (or any invalid JSON) will panic, and then the drop will also panic. This can cause a confusing SIGILL.
2 parents 5bb3023 + fa94e8a commit 79f962f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/testsuite/support/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ impl Execs {
11621162

11631163
impl Drop for Execs {
11641164
fn drop(&mut self) {
1165-
if !self.ran {
1165+
if !self.ran && !std::thread::panicking() {
11661166
panic!("forgot to run this command");
11671167
}
11681168
}

0 commit comments

Comments
 (0)