Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Unit Test: Shared::with_temp_db should use a non-exist path #4369

Conversation

eval-exec
Copy link
Collaborator

@eval-exec eval-exec commented Mar 5, 2024

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 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's Changed:

Related changes

  • PR to update owner/repo:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • None

Release note

None: Exclude this PR from the release note.

driftluo
driftluo previously approved these changes Mar 5, 2024
Signed-off-by: Eval EXEC <execvy@gmail.com>
Copy link

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale To be closed due to a lack of activity label Jul 26, 2024
@eval-exec eval-exec closed this Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale To be closed due to a lack of activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants