-
Notifications
You must be signed in to change notification settings - Fork 37.7k
test: Avoid intermittent timeout in p2p_headers_sync_with_minchainwork.py #30761
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
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. |
Example: https://drahtbot.space/temp_scratch/p2p_headers_sync_with_minchainwork_257.tar.zstd , which contains a |
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.
Concept ACK
Left a question/suggestion.
def mocktime_all(self, time): | ||
for n in self.nodes: | ||
n.setmocktime(time) | ||
|
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.
Setting mock time for all nodes seems like it could potentially be useful in multiple functional tests. Maybe it could be added to BitcoinTestFramework
rather than live in this functional test?
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.
Possibly. I guess, if another test needs it, it should be trivial to move?
Edit: To extend on that,
- I is unclear whether another test will need this, so moving to the framework seems too early.
- The framework already has methods on the test node to deal with mocktime, so adding more will increase the complexity and bloat even more.
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.
That's reasonable. I don't feel super strongly about it.
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 fa247e6. Checked the timeout downloading block logs before/after using setmocktime
.
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 fa247e6
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 fa247e6. Post merge
…k.py Github-Pull: bitcoin#30761 Rebased-From: fa247e6
b2a1379 depends: build libevent with -D_GNU_SOURCE (fanquake) 199bb09 test: fixing failing system_tests/run_command under some Locales (Jadi) 342baab test: Avoid intermittent timeout in p2p_headers_sync_with_minchainwork.py (MarcoFalke) 5577d5a test: fix `TestShell` initialization (late follow-up for #30463) (Sebastian Falbesoner) Pull request description: Backports: * #30714 * #30743 * #30761 * #30788 ACKs for top commit: willcl-ark: ACK b2a1379 achow101: ACK b2a1379 stickies-v: ACK b2a1379 Tree-SHA512: bf08ac0c613395def974a1b287345d4a64edc066c14f8c9f0184478b0e33e48333760eeb6e96b6b5fbafbb21b40d01875e3f526213a2734e226b2e111d71f3a3
Similar to #30705:
The goal of this test case is to check that the sync works at all, not to check any timeout.
On extremely slow hardware (for example qemu virtual hardware), downloading the 4110 BLOCKS_TO_MINE may take longer than the block download timeout.
Fix it by pinning the time using mocktime temporarily, and advance it immediately after the sync.