-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: move sync_blocks and sync_mempool functions to test_framework.py #19208
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
|
Nice! Concept ACK |
|
Seems like the style of those files are auto-formatted by One question about the implementation. Does it make sense to move |
|
Looks like |
sync_blocks and sync_mempool functions to test_framework.py|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Could someone explain what does conflicts mean here? Is there a logical order of PRs mentioned + mine to review and merge? |
|
@ycshao DrahtBot crawls over open PRs and alerts you when there is a conflict with the main branch that requires a rebase or, in this case, other PRs that may lead to future conflicts indicating that you are working on similar code. DrahtBot is not sentient enough to decide the merge order. It's just raising it to your attention. |
|
Re the format - autopep8 is making the diff much larger. I think it's easier, for now, to keep the diff as minimal as possible so reviewers can focus on the changes relevant to your patch. At the very least, you can break the formatting changes into their own commit and follow the lead of this reformat. I'd also suggest squashing your second commit since the first commit doesn't pass the linter without it. |
|
@adamjonas thanks for the answer and suggestion. I'll squash and break formatting into it's own commit. |
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.
Oo first PR? Concept ACK :) I'm guessing "contextual information of test framework" is the timeout_factor?
+1 to Jonas, just appeasing test/lint/lint-python.sh for now would be better.
Does it make sense to move
assert (all([len(x.getpeerinfo()) for x in rpc_connections]))up to immediately after the while loop starts? It will assert sooner and save some time and operations.
I had this thought too. But I think it would fail if the nodes happened to all be synced up (despite not being connected right now) before the first iteration of the while loop. I think it's possible...?
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.
I have a question - it's probably not a big deal to require at least one node to be updated, but would it be appropriate to have an optional blockhash parameter and enforce that hash instead?
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.
I don't see a use case like that in current code. But I think one benefit your idea will give is to shorten test run time if the block we need to sync to is not usually the tip.
Yeah for now
I guess it's theoretically possible. |
maflcko
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.
Concept ACK, but please change the commit title to
test: move sync_blocks and sync_mempool functions to test_framework.py
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.
why is this changed?
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.
I removed **kwargs which are not used.
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.
I think they might come in handy in the future. Is there a reason they will be unused forever?
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.
I feel it's better to add it when it will be used in instead of putting it there up front just because some time in the future it might be used. What do you think?
|
Please squash your commits according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits and change the commit title to something more meaningful: #19208 (review) |
|
ACK cc84460 , reviewed with --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space 💫 Show signature and timestampSignature: Timestamp of file with hash |
|
@MarcoFalke @gzhao408 @adamjonas thanks for reviewing and merge! |
2488ebc test: move sync_blocks and sync_mempool functions to test_framework.py (random-zebra) d076c81 [Test] Fix intermittent sync_blocks failures (random-zebra) f0de789 Move g_is_mempool_loaded into CTxMemPool::m_is_loaded (Ben Woosley) 0169a75 rpc: Expose g_is_mempool_loaded via getmempoolinfo and /rest/mempool/info.json (Ben Woosley) Pull request description: Backport the following PRs: - bitcoin#15323: rpc: Expose g_is_mempool_loaded via getmempoolinfo - bitcoin#18873: test: Fix intermittent sync_blocks failures - bitcoin#19208: test: move sync_blocks and sync_mempool functions to test_framework.py ACKs for top commit: furszy: nice finding!, code review ACK 2488ebc. Fuzzbawls: ACK 2488ebc Tree-SHA512: 4971a0076b4179b78c5338073a10fbf0649310c2cf3907cff1ab5c02f8dd67f5f7bb4bf524d69c554c8317bd98ce46411ff740aff676ed147525c75d83214976
Summary: This is a backport of [[bitcoin/bitcoin#19208 | core#19208]] Test Plan: `ninja check-functional-extended` Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D9431
This PR moves
sync_blocksandsync_mempoolout fromtest_framework/util.pytotest_framework/test_framework.pyso they can take contextual information of test framework into account.test_framework.py**kwargswhich is not usedtimeout_factorwhen respecting timeout in function implementations../test/functional/test_runner.pyfixes #18930