Shared::with_temp_db is only used by unit test, and the rocksdb should be inited in a non exist path.
In the develop branch, if I assert that the path db_base_dir in Shared::with_temp_db does not exist, I encounter the following error:
$ make test
--- STDERR: ckb-verification-contextual tests::uncle_verifier::test_uncle_over_count ---
thread 'tests::uncle_verifier::test_uncle_over_count' panicked at 'In test code, Shared::with_temp_db created a db path that already exist: /run/user/1000/.tmpUXdHrL, db_id: 0', shared/src/shared_builder.rs:185:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
FAIL [ 0.012s] ckb-verification-contextual tests::uncle_verifier::test_uncle_proposals_hash
--- STDOUT: ckb-verification-contextual tests::uncle_verifier::test_uncle_proposals_hash ---
running 1 test
test tests::uncle_verifier::test_uncle_proposals_hash ... FAILED
failures:
failures:
tests::uncle_verifier::test_uncle_proposals_hash
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 17 filtered out; finished in 0.00s
--- STDERR: ckb-verification-contextual tests::uncle_verifier::test_uncle_proposals_hash ---
thread 'tests::uncle_verifier::test_uncle_proposals_hash' panicked at 'In test code, Shared::with_temp_db created a db path that already exist: /run/user/1000/.tmpmjLMrO, db_id: 0', shared/src/shared_builder.rs:185:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
FAIL [ 0.013s] ckb-verification-contextual tests::uncle_verifier::test_uncle_with_uncle_descendant
--- STDOUT: ckb-verification-contextual tests::uncle_verifier::test_uncle_with_uncle_descendant ---
running 1 test
test tests::uncle_verifier::test_uncle_with_uncle_descendant ... FAILED
failures:
failures:
tests::uncle_verifier::test_uncle_with_uncle_descendant
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 17 filtered out; finished in 0.00s
--- STDERR: ckb-verification-contextual tests::uncle_verifier::test_uncle_with_uncle_descendant ---
thread 'tests::uncle_verifier::test_uncle_with_uncle_descendant' panicked at 'In test code, Shared::with_temp_db created a db path that already exist: /run/user/1000/.tmpYeObhI, db_id: 0', shared/src/shared_builder.rs:185:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: test run failed
make: *** [Makefile:33: test] Error 100
What problem does this PR solve?
Shared::with_temp_db
is only used by unit test, and the rocksdb should be inited in a non exist path.In the develop branch, if I assert that the path
db_base_dir
inShared::with_temp_db
does not exist, I encounter the following error:What's Changed:
Related changes
owner/repo
:Check List
Tests
Side effects
Release note