From fa94e8aab49fb77bbe8bcc4d9e221495c5a7138c Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Thu, 13 Dec 2018 11:55:38 -0800 Subject: [PATCH] Fix panic-in-panic in tests. There are some very rare circumstances that can cause a double panic during development. For example, `.with_json("")` will panic, and then the drop will also panic. --- tests/testsuite/support/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testsuite/support/mod.rs b/tests/testsuite/support/mod.rs index cc7eb09cde0..4196efc3add 100644 --- a/tests/testsuite/support/mod.rs +++ b/tests/testsuite/support/mod.rs @@ -1162,7 +1162,7 @@ impl Execs { impl Drop for Execs { fn drop(&mut self) { - if !self.ran { + if !self.ran && !std::thread::panicking() { panic!("forgot to run this command"); } }