[qa] Fix race condition in p2p_compactblocks #12629

pull dagurval wants to merge 1 commits into bitcoin:master from dagurval:qa-race changing 1 files +6 −2
  1. dagurval commented at 10:42 am on March 7, 2018: contributor

    Fixes a race where node1 processes the previous block submitted, between the two getblockcount calls on node1.

    When that happens on the last block, then the test would fail on getblockhash with error “Block height out of range”.

    Fixed by calling getblockcount once only.

  2. [qa] Fix race condition in p2p_compactblocks
    Fixes a race where node1 processes the previous block submitted,
    between the two getblockcount calls on node1.
    
    When that happens on the last block, then the test would fail on
    "getblockhash()" with error "Block height out of range".
    6db187778e
  3. fanquake added the label Tests on Mar 7, 2018
  4. dagurval commented at 11:51 am on March 7, 2018: contributor
    On further investigation it looks like submitblock is a blocking call and the issue was unrelated.
  5. dagurval closed this on Mar 7, 2018

  6. dagurval deleted the branch on Mar 7, 2018
  7. Empact commented at 10:09 am on April 13, 2018: member

    Possibly related CI failure:

     0  File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/test_framework/test_framework.py", line 147, in main
     1    self.run_test()
     2  File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/p2p_compactblocks.py", line 807, in run_test
     3    self.test_sendcmpct(self.nodes[1], self.segwit_node, 2, old_node=self.old_node)
     4  File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/p2p_compactblocks.py", line 172, in test_sendcmpct
     5    check_announcement_of_new_block(node, test_node, lambda p: "cmpctblock" not in p.last_message)
     6  File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/p2p_compactblocks.py", line 163, in check_announcement_of_new_block
     7    peer.wait_for_block_announcement(block_hash, timeout=30)
     8  File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/p2p_compactblocks.py", line 81, in wait_for_block_announcement
     9    wait_until(received_hash, timeout=timeout, lock=mininode_lock)
    10  File "/home/travis/build/bitcoin/bitcoin/build/bitcoin-x86_64-unknown-linux-gnu/test/functional/test_framework/util.py", line 227, in wait_until
    11    raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout))
    12AssertionError: Predicate (['        def received_hash():\n', '            return (block_hash in self.announced_blockhashes)\n'], 79) not true after 30 seconds 
    

    https://travis-ci.org/bitcoin/bitcoin/jobs/365906782#L6785

  8. Empact commented at 10:32 am on April 13, 2018: member
  9. MarcoFalke commented at 1:50 pm on April 13, 2018: member
    @Empact Please submit this as a new issue
  10. DrahtBot locked this on Dec 16, 2021

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-07-03 13:13 UTC

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