rust-bitcoin / bitcoind

Utility to launch a regtest bitcoind process in a rust test
MIT License
41 stars 34 forks source link

`cargo test` failing on macOS #85

Open noib3 opened 2 years ago

noib3 commented 2 years ago

cargo test is failing on macOS with the following error message:

Error msg ``` running 8 tests test test::test_local_ip ... ok test test::test_bitcoind_rpcuser_and_rpcpassword ... ok test test::test_bitcoind_rpcauth ... FAILED test test::test_multi_p2p ... FAILED test test::test_p2p ... FAILED test test::test_bitcoind ... FAILED test test::test_data_persistence ... FAILED test test::test_multi_wallet ... FAILED failures: ---- test::test_bitcoind_rpcauth stdout ---- thread 'test::test_bitcoind_rpcauth' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpc(Rpc(RpcError { code: -4, message: "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?\n", data: None }))', src/lib.rs:683:56 ---- test::test_multi_p2p stdout ---- thread 'test::test_multi_p2p' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpc(Rpc(RpcError { code: -4, message: "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?\n", data: None }))', src/lib.rs:573:75 ---- test::test_p2p stdout ---- thread 'test::test_p2p' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpc(Rpc(RpcError { code: -4, message: "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?\n", data: None }))', src/lib.rs:524:57 ---- test::test_bitcoind stdout ---- thread 'test::test_bitcoind' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpc(Rpc(RpcError { code: -4, message: "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?\n", data: None }))', src/lib.rs:492:43 ---- test::test_data_persistence stdout ---- thread 'test::test_data_persistence' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpc(Rpc(RpcError { code: -4, message: "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?\n", data: None }))', src/lib.rs:544:72 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ---- test::test_multi_wallet stdout ---- thread 'test::test_multi_wallet' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpc(Rpc(RpcError { code: -4, message: "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?\n", data: None }))', src/lib.rs:601:43 failures: test::test_bitcoind test::test_bitcoind_rpcauth test::test_data_persistence test::test_multi_p2p test::test_multi_wallet test::test_p2p test result: FAILED. 2 passed; 6 failed; 0 ignored; 0 measured; 0 filtered out; finished in 17.18s ```

the output is the same if the tests are run with:

MaxFangX commented 1 year ago

cargo test fails for me too, except only when I pass in --features 23_0. cargo test --features 22_0 passes just fine. Ran on bitcoind version 28.0 and rust 1.66.

```bash $ RUST_BACKTRACE=0 ct --features 23_0 (0.28.0) Finished test [unoptimized + debuginfo] target(s) in 0.21s Running unittests src/lib.rs (target/debug/deps/bitcoind-2a7472b040ed2ee3) running 8 tests test test::test_local_ip ... ok test test::test_bitcoind_rpcuser_and_rpcpassword ... ok test test::test_bitcoind ... FAILED test test::test_bitcoind_rpcauth ... FAILED test test::test_p2p ... FAILED test test::test_multi_p2p ... FAILED test test::test_multi_wallet ... FAILED test test::test_data_persistence ... FAILED failures: ---- test::test_bitcoind stdout ---- thread 'test::test_bitcoind' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpc(Rpc(RpcError { code: -4, message: "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?\n", data: None }))', src/lib.rs:492:43 ---- test::test_bitcoind_rpcauth stdout ---- thread 'test::test_bitcoind_rpcauth' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpc(Rpc(RpcError { code: -4, message: "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?\n", data: None }))', src/lib.rs:683:56 ---- test::test_p2p stdout ---- thread 'test::test_p2p' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpc(Rpc(RpcError { code: -4, message: "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?\n", data: None }))', src/lib.rs:524:57 ---- test::test_multi_p2p stdout ---- thread 'test::test_multi_p2p' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpc(Rpc(RpcError { code: -4, message: "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?\n", data: None }))', src/lib.rs:573:75 ---- test::test_multi_wallet stdout ---- thread 'test::test_multi_wallet' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpc(Rpc(RpcError { code: -4, message: "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?\n", data: None }))', src/lib.rs:601:43 ---- test::test_data_persistence stdout ---- thread 'test::test_data_persistence' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpc(Rpc(RpcError { code: -4, message: "Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?\n", data: None }))', src/lib.rs:544:72 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace failures: test::test_bitcoind test::test_bitcoind_rpcauth test::test_data_persistence test::test_multi_p2p test::test_multi_wallet test::test_p2p test result: FAILED. 2 passed; 6 failed; 0 ignored; 0 measured; 0 filtered out; finished in 17.82s error: test failed, to rerun pass `--lib` ```
MaxFangX commented 3 months ago

Update:

Both tested with rust 1.79.

I think this issue can be closed, unless someone else wants to confirm.

```bash $ RUST_BACKTRACE=0 cargo test --features 23_0 (0.30.0) Finished `test` profile [unoptimized + debuginfo] target(s) in 0.22s Running unittests src/lib.rs (target/debug/deps/bitcoind-ecfa81a5abe33dbc) running 10 tests test test::test_local_ip ... ok test test::test_bitcoind_rpcuser_and_rpcpassword ... ok test test::test_get_cookie_user_and_pass ... ok test test::test_getindexinfo ... ok test test::test_bitcoind_rpcauth ... ok test test::test_bitcoind ... ok test test::test_p2p ... ok test test::test_multi_p2p ... ok test test::test_data_persistence ... ok test test::test_multi_wallet ... ok test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 24.45s Doc-tests bitcoind running 1 test test src/lib.rs - Conf (line 162) ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.59s ``` ```bash $ RUST_BACKTRACE=0 cargo test --features 26_0 (master) Finished `test` profile [unoptimized + debuginfo] target(s) in 0.11s Running unittests src/lib.rs (target/debug/deps/bitcoind-6b750bf11f392c13) running 12 tests test test::test_local_ip ... ok test test::test_bitcoind_rpcuser_and_rpcpassword ... ok test test::zmq_interface_enabled ... ok test test::zmq_interface_disabled ... ok test test::test_get_cookie_user_and_pass ... ok test test::test_getindexinfo ... ok test test::test_bitcoind ... ok test test::test_bitcoind_rpcauth ... ok test test::test_p2p ... ok test test::test_multi_p2p ... ok test test::test_data_persistence ... ok test test::test_multi_wallet ... ok test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 25.64s Doc-tests bitcoind running 1 test test src/lib.rs - Conf (line 173) ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.33s ```