Skip to content

Commit 3ff4890

Browse files
committed
Add test that drops the node in an async context
.. as tokio tends to panic if dropping a runtime in an async context and we're not super careful. Here, we add some test coverage for this edge case in Rust tests.
1 parent a147ad0 commit 3ff4890

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/integration_tests_rust.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,3 +1457,14 @@ fn spontaneous_send_with_custom_preimage() {
14571457
panic!("Expected receiver to have spontaneous PaymentKind with preimage");
14581458
}
14591459
}
1460+
1461+
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
1462+
async fn drop_in_async_context() {
1463+
let (_bitcoind, electrsd) = setup_bitcoind_and_electrsd();
1464+
let chain_source = TestChainSource::Esplora(&electrsd);
1465+
let seed_bytes = vec![42u8; 64];
1466+
1467+
let config = random_config(true);
1468+
let node = setup_node(&chain_source, config, Some(seed_bytes));
1469+
node.stop().unwrap();
1470+
}

0 commit comments

Comments
 (0)