test: Add SyncWithValidationInterfaceQueue to mockscheduler RPC
This makes existing tests less brittle, see
https://github.com/bitcoin/bitcoin/pull/28108/files#r1268966663
fa1640617e
refactor: Use EnsureAnyNodeContext
node_context is never null, but if it was, it would lead to a nullptr
dereference in node_context->scheduler. Just use EnsureAnyNodeContext
everywhere for more robust, consistent, and correct code.
fabef121b0
DrahtBot
commented at 1:10 PM on July 21, 2023:
contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See 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.
DrahtBot added the label Tests on Jul 21, 2023
DrahtBot added the label CI failed on Jul 25, 2023
DrahtBot removed the label CI failed on Jul 25, 2023
TheCharlatan approved
TheCharlatan
commented at 9:55 AM on July 28, 2023:
contributor
ACKfabef121b0cdfac6ec1985f6c08c5685a886ba5a
Seems like the correct thing to do here anyway. Also reproduced the feature_fee_estimation behavior change.
furszy
commented at 1:59 PM on July 28, 2023:
member
Little topic, mainly to not mix RPC commands responsibilities.
Why not implementing this on the test framework instead?
Could add a proxy function mockscheduler to test_node.py that calls to the real mockscheduler and, subsequently to syncwithvalidationinterfacequeue.
maflcko
commented at 2:17 PM on July 28, 2023:
member
Why not implementing this on the test framework instead?
That just seems brittle, and bloated, for no reason? It is brittle because one may miss to implement a proxy, as they'll have to be done for the bitcoin-cli utility and the python rpc wrapper, and devs can still accidentally sidestep it. It is bloated because it will be more than one line of code.
furszy
commented at 2:45 PM on July 28, 2023:
member
That just seems brittle, and bloated, for no reason? It is brittle because one may miss to implement a proxy, as they'll have to be done for the bitcoin-cli utility and the python rpc wrapper, and devs can still accidentally sidestep it. It is bloated because it will be more than one line of code.
I'm not really strong here but It just seems a bit error-prone to always call to the syncwithvalidationinterfacequeue internally after bumping the scheduler timeout and not before. Existing callbacks using the node's time to operate could be affected and perform differently (sometimes we might want this, some others we might not?). And thought that it would be easier to change/adapt when calls are done outside of the RPC command.
But it is just a gut feeling. All good either way.
maflcko
commented at 2:55 PM on July 28, 2023:
member
Existing callbacks using the node's time to operate could be affected and perform differently
No, they shouldn't be affected by this change. The scheduler thread is already free to behave at any time as-if syncwithvalidationinterfacequeue was just called.
This will only reduce intermittent test failure rates where the test assumed that the scheduler thread behaved as-if syncwithvalidationinterfacequeue was called and that it must happen within a specific time. As explained in the description there are tests with this assumption. This pull request fixes those tests, and all other cases of the same kind in all current and future tests.
furszy approved
furszy
commented at 3:07 PM on July 28, 2023:
member
Code review ACKfabef121. Convinced by checking all current tests usages.
Thanks Marco.
fanquake merged this on Jul 30, 2023
fanquake closed this on Jul 30, 2023
maflcko deleted the branch on Jul 30, 2023
sidhujag referenced this in commit 0b441ee07c on Aug 9, 2023
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:13 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me