-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
test: expand LimitOrphan and EraseForPeer coverage #30082
base: master
Are you sure you want to change the base?
test: expand LimitOrphan and EraseForPeer coverage #30082
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
src/test/orphanage_tests.cpp
Outdated
// Jump ORPHAN_TX_EXPIRE_TIME minutes, orphan should be timed out on limiting | ||
SetMockTime(GetTime() + 20 * 60); | ||
BOOST_CHECK_EQUAL(orphanage.CountOrphans(), 1); | ||
orphanage.LimitOrphans(1, rng); | ||
BOOST_CHECK_EQUAL(orphanage.CountOrphans(), 0); |
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.
Maybe out of scope but I wonder if it would be best to add a current_time
parameter to the TxOrphanage
methods to make it easier to test and fuzz the expiration (also should have a test for the sorting for GetChildrenFromSamePeer
results)
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.
probably a good idea, though you might have better opinions on orphanage interface. I tightened the time testing a bit more by setting mocktime at beginning, then checking boundary conditions via subsequent setting of the time.
bb2389a
to
dd7bf60
Compare
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.
lgtm
dd7bf60
to
6f70bf4
Compare
6f70bf4
to
6831f39
Compare
rebased due to silent merge conflict, with cleanups suggested by @glozow 👍 |
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.
almost ack 6831f39, thanks for taking suggestions
6831f39
to
eaf4de0
Compare
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.
ACK eaf4de0
Inspired by refactorings in #30000 as the coverage appeared a bit sparse.
Added some minimal border value testing, timeouts, and tightened existing assertions.