Don't panic in Offchain test context, when we are already panicking (#3996)

This commit is contained in:
Bastian Köcher
2019-11-01 17:14:21 +01:00
committed by GitHub
parent 596ac7bd1f
commit 6193481352
+2 -1
View File
@@ -119,7 +119,8 @@ impl State {
impl Drop for State {
fn drop(&mut self) {
if !self.expected_requests.is_empty() {
// If we panic! while we are already in a panic, the test dies with an illegal instruction.
if !self.expected_requests.is_empty() && !std::thread::panicking() {
panic!("Unfulfilled expected requests: {:?}", self.expected_requests);
}
}