HomePhabricator

[qa] Wait for specific block announcement in p2p-compactblocks

Description

[qa] Wait for specific block announcement in p2p-compactblocks

Change check_announcement_of_new_block() to wait specifically for the
announcement of the newly created block, instead of waiting for any
announcement at all. A difficult to reproduce failure in
check_announcement_of_new_block() that happened in a travis build
(https://travis-ci.org/bitcoin/bitcoin/jobs/175198367) might have happened
because an older announcement was mistaken for the expected one. The error
looked like:

Assertion failed: Failed

File ".../bitcoin/qa/rpc-tests/test_framework/test_framework.py", line 145, in main
  self.run_test()
File ".../bitcoin/build/../qa/rpc-tests/p2p-compactblocks.py", line 787, in run_test
  self.test_sendcmpct(self.nodes[1], self.segwit_node, 2, old_node=self.old_node)
File ".../bitcoin/build/../qa/rpc-tests/p2p-compactblocks.py", line 201, in test_sendcmpct
  check_announcement_of_new_block(node, test_node, lambda p: p.last_cmpctblock is None and p.last_inv is not None)
File ".../bitcoin/build/../qa/rpc-tests/p2p-compactblocks.py", line 194, in check_announcement_of_new_block
  assert(predicate(peer))

This commit also changes the assertion failed message above to include more
detailed information for debug.

Details

Provenance
Russell Yanofsky <russ@yanofsky.org>Authored on Nov 14 2016, 14:58
deadalnixPushed on May 14 2017, 22:04
Parents
rABC87ab49e4fe38: Merge #9124: Use better name for local variable to prevent -Wshadow compiler…
Branches
Unknown
Tags
Unknown

Event Timeline

Russell Yanofsky <russ@yanofsky.org> committed rABCdfa44d1b07a6: [qa] Wait for specific block announcement in p2p-compactblocks (authored by Russell Yanofsky <russ@yanofsky.org>).Nov 14 2016, 18:59