Page MenuHomePhabricator

[test] wait for inital broadcast before comparing mempool entries
AbandonedPublic

Authored by PiRK on Jan 22 2021, 02:12.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary
  • mempool entry 'unbroadcast' field changes when tx passes initial broadcast (receive getdata),

so anytime you compare mempool entries as a whole, you must wait for all broadcasts to complete
('unbroadcast' = False) otherwise the state may change in between calls

  • update P2PTxInvStore to send msg_getdata for invs and add functionality to wait for a list

of txids to complete initial broadcast

  • make mempool_packages.py wait because it compares entries using getrawmempool and

getmempoolentry

This concludes backport of Core PR18895 [4/4]
https://github.com/bitcoin/bitcoin/pull/18895/commits/651f1d816f054cb9c637f8a99c9360bba381ef58
Depends on D9024

Test Plan

ninja check-functional

Diff Detail

Event Timeline

PiRK requested review of this revision.Jan 22 2021, 02:12
PiRK planned changes to this revision.Jan 22 2021, 02:30

Failed tests logs:

====== Bitcoin ABC functional tests: mempool_packages.py ======

------- Stdout: -------
2021-01-22T02:27:28.609000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210122_022547/mempool_packages_496
2021-01-22T02:27:30.006000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 120, in main
    self.run_test()
  File "/work/test/functional/mempool_packages.py", line 77, in run_test
    self.nodes[0].p2p.wait_for_broadcast(chain)
  File "/work/test/functional/test_framework/mininode.py", line 769, in wait_for_broadcast
    self.wait_until(lambda: set(self.get_invs()) == set(
AttributeError: 'P2PTxInvStore' object has no attribute 'wait_until'
2021-01-22T02:27:30.057000Z TestFramework (INFO): Stopping nodes
2021-01-22T02:27:30.359000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210122_022547/mempool_packages_496
2021-01-22T02:27:30.359000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210122_022547/mempool_packages_496/test_framework.log
2021-01-22T02:27:30.359000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210122_022547/mempool_packages_496' to consolidate all logs

Each failure log is accessible here:
Bitcoin ABC functional tests: mempool_packages.py

Failed tests logs:

====== Bitcoin ABC functional tests: mempool_packages.py ======

------- Stdout: -------
2021-01-22T02:29:30.804000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210122_022807/mempool_packages_396
2021-01-22T02:29:32.148000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 120, in main
    self.run_test()
  File "/work/test/functional/mempool_packages.py", line 77, in run_test
    self.nodes[0].p2p.wait_for_broadcast(chain)
  File "/work/test/functional/test_framework/mininode.py", line 769, in wait_for_broadcast
    self.wait_until(lambda: set(self.get_invs()) == set(
AttributeError: 'P2PTxInvStore' object has no attribute 'wait_until'
2021-01-22T02:29:32.198000Z TestFramework (INFO): Stopping nodes
2021-01-22T02:29:32.501000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210122_022807/mempool_packages_396
2021-01-22T02:29:32.501000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210122_022807/mempool_packages_396/test_framework.log
2021-01-22T02:29:32.501000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210122_022807/mempool_packages_396' to consolidate all logs
====== Bitcoin ABC functional tests with the next upgrade activated: mempool_packages.py ======

------- Stdout: -------
2021-01-22T02:32:28.252000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210122_023105/mempool_packages_490
2021-01-22T02:32:29.932000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 120, in main
    self.run_test()
  File "/work/test/functional/mempool_packages.py", line 77, in run_test
    self.nodes[0].p2p.wait_for_broadcast(chain)
  File "/work/test/functional/test_framework/mininode.py", line 769, in wait_for_broadcast
    self.wait_until(lambda: set(self.get_invs()) == set(
AttributeError: 'P2PTxInvStore' object has no attribute 'wait_until'
2021-01-22T02:32:29.983000Z TestFramework (INFO): Stopping nodes
2021-01-22T02:32:30.686000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210122_023105/mempool_packages_490
2021-01-22T02:32:30.686000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210122_023105/mempool_packages_490/test_framework.log
2021-01-22T02:32:30.686000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210122_023105/mempool_packages_490' to consolidate all logs

Each failure log is accessible here:
Bitcoin ABC functional tests: mempool_packages.py
Bitcoin ABC functional tests with the next upgrade activated: mempool_packages.py

abandoned after being squashed into D9024. This fixes a test failure introduce 2 commits earlier