X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-background-processor%2Fsrc%2Flib.rs;h=c30e5ad667652cba466e8243b5558e6d42115b3a;hb=fcf1282975fe8627efdd7657ba3007640daedce8;hp=2b150cb3025afd8775a1a2b21143479d944195a3;hpb=3b8bf93251a9c8aa528c6961d572a611bc140eb5;p=rust-lightning diff --git a/lightning-background-processor/src/lib.rs b/lightning-background-processor/src/lib.rs index 2b150cb3..c30e5ad6 100644 --- a/lightning-background-processor/src/lib.rs +++ b/lightning-background-processor/src/lib.rs @@ -1186,7 +1186,9 @@ mod tests { let filepath = get_full_filepath("test_background_processor_persister_0".to_string(), "scorer".to_string()); check_persisted_data!(nodes[0].scorer, filepath.clone()); - assert!(bg_processor.stop().is_ok()); + if !std::thread::panicking() { + bg_processor.stop().unwrap(); + } } #[test] @@ -1208,7 +1210,9 @@ mod tests { } } - assert!(bg_processor.stop().is_ok()); + if !std::thread::panicking() { + bg_processor.stop().unwrap(); + } } #[test] @@ -1300,7 +1304,9 @@ mod tests { nodes[1].node.handle_channel_ready(&nodes[0].node.get_our_node_id(), &as_funding); let _bs_channel_update = get_event_msg!(nodes[1], MessageSendEvent::SendChannelUpdate, nodes[0].node.get_our_node_id()); - assert!(bg_processor.stop().is_ok()); + if !std::thread::panicking() { + bg_processor.stop().unwrap(); + } // Set up a background event handler for SpendableOutputs events. let (sender, receiver) = std::sync::mpsc::sync_channel(1); @@ -1326,7 +1332,9 @@ mod tests { _ => panic!("Unexpected event: {:?}", event), } - assert!(bg_processor.stop().is_ok()); + if !std::thread::panicking() { + bg_processor.stop().unwrap(); + } } #[test] @@ -1345,7 +1353,9 @@ mod tests { } } - assert!(bg_processor.stop().is_ok()); + if !std::thread::panicking() { + bg_processor.stop().unwrap(); + } } #[test] @@ -1519,6 +1529,8 @@ mod tests { _ => panic!("Unexpected event"), } - assert!(bg_processor.stop().is_ok()); + if !std::thread::panicking() { + bg_processor.stop().unwrap(); + } } }