test: Fix intermittent issue in p2p_addr_relay.py #21785
pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:2104-testInt changing 4 files +13 −13-
MarcoFalke commented at 11:12 am on April 27, 2021: member
-
fanquake added the label Tests on Apr 27, 2021
-
MarcoFalke force-pushed on Apr 27, 2021
-
MarcoFalke commented at 11:25 am on April 27, 2021: memberCan be reviewed with
--color-moved=dimmed-zebra
to reduce the review burden by 3 lines :sweat_smile: -
mzumsande commented at 11:35 am on April 27, 2021: memberThanks for the fix and Concept ACK. See #21707 (review) - there is another occurrence in
blocksonly_mode_tests
ofp2p_addr_relay.py
that should be changed as well - by calling thesend_addr_msg()
helper as suggested by John or directly there. -
MarcoFalke added the label Waiting for author on Apr 27, 2021
-
jonatack commented at 5:27 pm on April 27, 2021: memberConcept ACK, hit this issue today.
-
in test/functional/test_framework/p2p.py:551 in fa5211d9e0 outdated
547+ # been called at least once 548+ self.sync_with_ping() 549+ self.sync_with_ping() 550+ 551 def sync_with_ping(self, timeout=60): 552+ """Ensure any sent message on this connection is processed by ProcessMessages"""
amitiuttarwar commented at 6:44 pm on April 27, 2021:thanks for adding description here & in
sync_send_with_ping
, but imo it could be clearer. offering a suggestion incase you agree this captures the mechanism better:“Ensure the recipient node has run ProcessMessages for all previously sent p2p messages”
mzumsande commented at 7:38 pm on April 27, 2021:Isn’t ‘’any message" too strong (instead of “at least one message”), especially here but also above?ProcessMessages
,ProcessMessage
andSendMessages
can all return early. WithSendMessages
, it goes together with a disconnect, but forProcessMessage(s)
there are many other ways, so that in case of multiple messages not all might have been processed in this iteration of the loop.
amitiuttarwar commented at 8:19 pm on April 27, 2021:you make a good point, I was making an assumption about test setup that isn’t necessarily true.
MarcoFalke commented at 6:20 am on April 28, 2021:Tried to fix, thanksin test/functional/test_framework/p2p.py:543 in fa5211d9e0 outdated
538@@ -539,8 +539,16 @@ def send_and_ping(self, message, timeout=60): 539 self.send_message(message) 540 self.sync_with_ping(timeout=timeout) 541 542- # Sync up with the node 543+ def sync_send_with_ping(self, timeout=60): 544+ """Ensure any to-be-received message on this connection is processed by SendMessages"""
amitiuttarwar commented at 6:45 pm on April 27, 2021:to consider:
“Ensure the recipient node has run ProcessMessages and SendMessages for all previously sent p2p messages”
MarcoFalke commented at 6:20 am on April 28, 2021:Tried to fix, thanksamitiuttarwar commented at 6:47 pm on April 27, 2021: contributorACK fa5211d9e0, thanks for this fix. agree with mzumsande’s #21785 (comment), ready to reACK if you incorporate. also left some wording suggestions to consider.MarcoFalke removed the label Waiting for author on Apr 28, 2021test: Use self.send_addr_msg fa37116c82test: Fix intermittent issue in p2p_addr_relay.py faa51ef4d3MarcoFalke force-pushed on Apr 28, 2021mzumsande commented at 2:49 pm on April 28, 2021: memberACK faa51ef4d33034f8c14cfd18f1c01c90883a1bb4amitiuttarwar commented at 7:59 pm on April 28, 2021: contributorACK faa51ef4d33034f8c14cfd18f1c01c90883a1bb4fanquake merged this on Apr 29, 2021fanquake closed this on Apr 29, 2021
sidhujag referenced this in commit cabc2fb4b4 on Apr 29, 2021MarcoFalke deleted the branch on Apr 29, 2021jnewbery commented at 6:56 am on April 29, 2021: memberACK faa51ef4d33034f8c14cfd18f1c01c90883a1bb4. Looks good. Thanks Marco.luke-jr referenced this in commit 125ea425cf on Jun 27, 2021Fabcien referenced this in commit c8c8603007 on Jan 21, 2022gwillen referenced this in commit a02abbc35a on Jun 1, 2022DrahtBot locked this on Aug 16, 2022
github-metadata-mirror
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: 2024-12-19 00:12 UTC
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: 2024-12-19 00:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me