mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-24 23:08:36 +01:00
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.
This commit is contained in:
parent
1f1d7c6890
commit
d9fa8f1c38
1 changed files with 7 additions and 1 deletions
|
@ -416,7 +416,13 @@ mod tests {
|
|||
let persister = |_: &_| Err(std::io::Error::new(std::io::ErrorKind::Other, "test"));
|
||||
let event_handler = |_| {};
|
||||
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());
|
||||
let _ = bg_processor.thread_handle.join().unwrap().expect_err("Errored persisting manager: test");
|
||||
match bg_processor.stop() {
|
||||
Ok(_) => panic!("Expected error persisting manager"),
|
||||
Err(e) => {
|
||||
assert_eq!(e.kind(), std::io::ErrorKind::Other);
|
||||
assert_eq!(e.get_ref().unwrap().to_string(), "test");
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Reference in a new issue