-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: Run AppInitSanityChecks before all tests #21763
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
Conversation
fa81e13 to
fa8145a
Compare
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK fa8145af797a6dac2cff049399fc8d85fd30fe0b
Ran the tests several times and seems ok (MacOS 11.3)
|
Concept ACK |
|
@ryanofsky Any Concept NACK thoughts on this? |
ryanofsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryanofsky Any Concept NACK thoughts on this?
Code review ACK fa8145af797a6dac2cff049399fc8d85fd30fe0b, and this seems fine to me. I do have an irrational dislike of the sanity checks because they throw exceptions and cause GDB catch throw false positives. Also in the future, I think it would be good to strip down the base test class and make extra setup like this optional. But this seems like a good change to make for current tests to be more consistent with the app.
|
It seems somewhat overkill to run the sanity tests for every test, but they run fast so also no concept NACK. |
|
Reviewed fa8145a. Unit and functional tests are run successfully.
I can see After this change, 3 sanity checks (stdlib, secp256k1, chrono) which were in |
fae4252 to
2222701
Compare
I think any code may throw exceptions, so I am wondering if this is something specific to init code?
Agree, though the |
Without any warranty, this may be possible by removing |
2222701 to
fa532cd
Compare
This is also run first in the main() function of bitcoind
fa532cd to
fa7e110
Compare
fa7e110 to
fa607f8
Compare
jamesob
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Github ACK fa607f8
More closely resembles bitcoind startup and removes code.
Also remove sanity unit tests, as they are run before all tests.
fa607f8 to
facdfb6
Compare
|
Force pushed to remove one more unit test |
ryanofsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK facdfb6
|
|
||
| #include <boost/test/unit_test.hpp> | ||
|
|
||
| BOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In commit "test: Run AppInitSanityChecks before all tests" (facdfb6)
I wish this commit would just add the AppInitSanityChecks assert without deleting the other tests. I don't see a reason to delete low level tests just because high level code calls some of the same functions. Low level tests can be useful because they can find identify errors that might be masked in high level tests that are changing other state. Also they can be provide more granular errors in case of failure, and they can serve as examples to show how low-level APIs can be called.
|
Closing for now to redirect review to other open pulls. |
Instead of running the sanity checks as part of a single test case, run them as part of the normal setup for each test case. Benefits are: