Skip to content

Commit 91d96fe

Browse files
committed
fix(test): remove lazy_static and call Drop on test exit
Fixes the resource leakage issue on the test suite caused due to the `BITCOIND` and `ELECTRSD` statics not being `Drop`ped on exit. This is done by registering a cleanup routine via `libc`'s `atexit`. Once the process terminates, we take ownership of `BITCOIND` and `ELECTRSD` and call `drop()` on them.
1 parent e0f7985 commit 91d96fe

File tree

2 files changed

+143
-97
lines changed

2 files changed

+143
-97
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ tokio = { version = "1", features = ["time"], optional = true }
3434
[dev-dependencies]
3535
tokio = { version = "1.20.1", features = ["full"] }
3636
electrsd = { version = "0.33.0", features = ["legacy", "esplora_a33e97e1", "corepc-node_28_0"] }
37-
lazy_static = "1.4.0"
3837

3938
[features]
4039
default = ["blocking", "async", "async-https", "tokio"]

0 commit comments

Comments
 (0)