test: Fix intermittent issue in mempool_reorg #28321

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2308-test-less-red- changing 1 files +3 −3
  1. maflcko commented at 9:10 am on August 22, 2023: member

    Currently the test case may fail intermittently, see #28313

    Fix this by changing a number and reducing the failure rate a bit.

  2. test: Fix intermittent issue in mempool_reorg fa5cc3ccfb
  3. DrahtBot commented at 9:10 am on August 22, 2023: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK glozow

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Tests on Aug 22, 2023
  5. maflcko requested review from glozow on Aug 22, 2023
  6. maflcko added this to the milestone 26.0 on Aug 22, 2023
  7. in test/functional/mempool_reorg.py:95 in fa5cc3ccfb
    91@@ -92,7 +92,7 @@ def test_reorg_relay(self):
    92             # However, the node will answer requests for the tx from the recently-disconnected block.
    93             assert_equal(peer1.last_message["tx"].tx.getwtxid(),tx_disconnected["tx"].getwtxid())
    94 
    95-        self.nodes[1].setmocktime(int(time.time()) + 30)
    96+        self.nodes[1].setmocktime(int(time.time()) + 300)
    


    glozow commented at 1:41 pm on August 22, 2023:

    Seems like due to poisson announcement timer, with a small probability, the announcement hasn’t been scheduled yet. A more sure way to fix this is to revert to system time and just wait for the invs:

    0        # Reset to system time
    1        self.nodes[1].setmocktime(0)
    2        peer1.wait_for_broadcast([tx_before_reorg["tx"].getwtxid(), tx_child["tx"].getwtxid(), tx_disconnected["tx"].getwtxid()])
    

    (And then delete L97-101)


    maflcko commented at 1:51 pm on August 22, 2023:

    wait_for_broadcast has a (default) timeout of 60 seconds, which I can use here, if you don’t like the 300.

    Other than that, I think it is fine to use mocktime here.


    glozow commented at 2:07 pm on August 22, 2023:
    Oh true. I suppose in the very rare scenario that it’s a really long time, fastforward + immediately fail is better than waiting 60 seconds and failing. Would prefer 60 over 300 but nbd.
  8. glozow commented at 1:42 pm on August 22, 2023: member
    Concept ACK, thanks Marco
  9. glozow commented at 2:08 pm on August 22, 2023: member
    ACK fa5cc3ccfb15d05775ace9c1827b06203ce17116
  10. fanquake merged this on Aug 24, 2023
  11. fanquake closed this on Aug 24, 2023

  12. maflcko deleted the branch on Aug 24, 2023
  13. Frank-GER referenced this in commit 5d149ca1fa on Sep 8, 2023
  14. bitcoin locked this on Aug 23, 2024


maflcko DrahtBot glozow

Labels
Tests

Milestone
26.0


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-09-29 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me