Static references don't run their destructors. This means we can end up leaking resources after running the test suite. This issue is only related to tests and not a bug in the library.
|
lazy_static! { |
|
static ref BITCOIND: corepc_node::Node = { |
|
let bitcoind_exe = env::var("BITCOIND_EXE") |
|
.ok() |
|
.or_else(|| corepc_node::downloaded_exe_path().ok()) |
|
.expect( |
|
"you need to provide an env var BITCOIND_EXE or specify a bitcoind version feature", |
|
); |
|
let conf = corepc_node::Conf::default(); |
|
corepc_node::Node::with_conf(bitcoind_exe, &conf).unwrap() |
|
}; |
To reproduce
cargo test -- --test-threads=1
ps aux | grep bitcoind
Additional Context
Static references don't run their destructors. This means we can end up leaking resources after running the test suite. This issue is only related to tests and not a bug in the library.
rust-esplora-client/src/lib.rs
Lines 281 to 291 in 9305e41
To reproduce
cargo test -- --test-threads=1ps aux | grep bitcoindAdditional Context
drop.impl Drop for Node