Skip to content

Commit 672a332

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 a0d7ad4 commit 672a332

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
@@ -1381,3 +1381,14 @@ fn facade_logging() {
13811381
validate_log_entry(entry);
13821382
}
13831383
}
1384+
1385+
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
1386+
async fn drop_in_async_context() {
1387+
let (_bitcoind, electrsd) = setup_bitcoind_and_electrsd();
1388+
let chain_source = TestChainSource::Esplora(&electrsd);
1389+
let seed_bytes = vec![42u8; 64];
1390+
1391+
let config = random_config(true);
1392+
let node = setup_node(&chain_source, config, Some(seed_bytes));
1393+
node.stop().unwrap();
1394+
}

0 commit comments

Comments
 (0)