mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 18:11:10 +00:00
Don't panic in Offchain test context, when we are already panicking (#3996)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user