Skip to content

Commit d9fa8f1

Browse files
committed
Correctly assert BackgroundProcessor error
The specific error from the ChannelManager persister is not asserted for in test_persist_error. Rather, any error will do. Update the test to use BackgroundProcessor::stop and assert for the expected value.
1 parent 1f1d7c6 commit d9fa8f1

File tree

1 file changed

+7
-1
lines changed
  • lightning-background-processor/src

1 file changed

+7
-1
lines changed

lightning-background-processor/src/lib.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,13 @@ mod tests {
416416
let persister = |_: &_| Err(std::io::Error::new(std::io::ErrorKind::Other, "test"));
417417
let event_handler = |_| {};
418418
let bg_processor = BackgroundProcessor::start(persister, event_handler, nodes[0].chain_monitor.clone(), nodes[0].node.clone(), nodes[0].peer_manager.clone(), nodes[0].logger.clone());
419-
let _ = bg_processor.thread_handle.join().unwrap().expect_err("Errored persisting manager: test");
419+
match bg_processor.stop() {
420+
Ok(_) => panic!("Expected error persisting manager"),
421+
Err(e) => {
422+
assert_eq!(e.kind(), std::io::ErrorKind::Other);
423+
assert_eq!(e.get_ref().unwrap().to_string(), "test");
424+
},
425+
}
420426
}
421427

422428
#[test]

0 commit comments

Comments
 (0)