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 test error: set allow_dirty to true for db2 to make test pass #67

Merged
merged 1 commit into from
May 15, 2020

Conversation

b1aafulei
Copy link

Previously, in test/test.cpp of the branch v2.0.x, it was

chainbase::database db(temp, database::read_write, 1024*1024*8);
chainbase::database db2(temp); /// open an already created db

The test would always fail, complaining that database dirty flag set.

Now the above code is changed into

chainbase::database db(temp, database::read_write, 1024*1024*8);
chainbase::database db2(temp, database::read_only, 0, true); /// open an already created db

so that it becomes okay for db2 to start off from a dirty database opened by db, and thus the test would pass.

Note that the branch v2.0.x is currently tracked by both the master and release/2.0.x branches of EOSIO/eos. It would be desired if we can make the test pass.

@heifner
Copy link

heifner commented May 11, 2020

Why are these tests not run as part of eosio?

@b1aafulei
Copy link
Author

Hi Kevin. Thanks for the question!

The current automated tests in the EOSIO/eos repository are driven by ctest and run by buildkite. This chainbase_test was not added in the CMakeLists as a ctest test, and thus is not run automatically as part of eosio.

It should be however. I have made some changes to the CMakeLists in this pull request. Now the chainbase_test will be included in the ctest. Care has been taken so that it will work properly, either when EOSIO/chainbase is a standalone library, or when EOSIO/chainbase is a submodule for the EOSIO/eos repository.

Of course, this fix targets only the EOSIO/chainbase:v2.0.x branch, and should affect the EOSIO/eos:release/2.0.x and EOSIO/eos:master branches.

@revl revl self-requested a review May 15, 2020 01:24
Copy link

@revl revl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants