File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,7 @@ impl TestChannelMessageHandler {
270
270
fn received_msg ( & self , ev : wire:: Message < ( ) > ) {
271
271
let mut msgs = self . expected_recv_msgs . lock ( ) . unwrap ( ) ;
272
272
if msgs. is_none ( ) { return ; }
273
+ assert ! ( !msgs. as_ref( ) . unwrap( ) . is_empty( ) , "Received message when we weren't expecting one" ) ;
273
274
#[ cfg( test) ]
274
275
assert_eq ! ( msgs. as_ref( ) . unwrap( ) [ 0 ] , ev) ;
275
276
msgs. as_mut ( ) . unwrap ( ) . remove ( 0 ) ;
@@ -279,7 +280,9 @@ impl TestChannelMessageHandler {
279
280
impl Drop for TestChannelMessageHandler {
280
281
fn drop ( & mut self ) {
281
282
let l = self . expected_recv_msgs . lock ( ) . unwrap ( ) ;
282
- assert ! ( l. is_none( ) || l. as_ref( ) . unwrap( ) . is_empty( ) ) ;
283
+ if !std:: thread:: panicking ( ) {
284
+ assert ! ( l. is_none( ) || l. as_ref( ) . unwrap( ) . is_empty( ) ) ;
285
+ }
283
286
}
284
287
}
285
288
You can’t perform that action at this time.
0 commit comments