Page MenuHomePhabricator

test: check for matching object hashes in wait_for_getdata
ClosedPublic

Authored by PiRK on Jan 19 2021, 16:21.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCb6aa3c347dd0: test: check for matching object hashes in wait_for_getdata
Summary

Previously, wait_for_getdata only looked for the presence of a recent "getdata" message. Additionally checking the object hashes inside the message should make tests involving wait_for_getdata more robust.

p2p_sendheaders.py already overrides wait_for_getdata do this check; we can use the same approach consistently across all tests that call wait_for_getdata.

This is a backport of Core PR18690

Test Plan

ninja check-functional

Diff Detail

Event Timeline

PiRK requested review of this revision.Jan 19 2021, 16:21

Failed tests logs:

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

------- Stdout: -------
2021-01-19T16:29:51.372000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210119_162950/rpc_bind_591
2021-01-19T16:29:51.373000Z TestFramework (INFO): Check for linux
2021-01-19T16:29:51.421000Z TestFramework (INFO): Check for ipv6
2021-01-19T16:29:51.421000Z TestFramework (INFO): Check for non-loopback interface
2021-01-19T16:29:51.421000Z TestFramework (INFO): Bind test for []
2021-01-19T16:29:52.658000Z TestFramework (INFO): Bind test for []
2021-01-19T16:29:53.181000Z TestFramework (INFO): Bind test for ['[::1]']
2021-01-19T16:29:53.708000Z TestFramework (INFO): Bind test for ['127.0.0.1', '[::1]']
2021-01-19T16:29:54.185000Z TestFramework (INFO): Using interface 172.17.0.2 for testing
2021-01-19T16:29:54.185000Z TestFramework (INFO): Bind test for ['172.17.0.2']
2021-01-19T16:29:54.472000Z 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/rpc_bind.py", line 136, in run_test
    self._run_nonloopback_tests()
  File "/work/test/functional/rpc_bind.py", line 171, in _run_nonloopback_tests
    [(self.non_loopback_ip, self.defaultport)])
  File "/work/test/functional/rpc_bind.py", line 72, in run_bind_test
    assert_equal(set(get_bind_addrs(pid)), set(expected))
  File "/work/test/functional/test_framework/netutil.py", line 87, in get_bind_addrs
    inodes = get_socket_inodes(pid)
  File "/work/test/functional/test_framework/netutil.py", line 37, in get_socket_inodes
    target = os.readlink(os.path.join(base, item))
FileNotFoundError: [Errno 2] No such file or directory: '/proc/7595/fd/16'
2021-01-19T16:29:54.523000Z TestFramework (INFO): Stopping nodes
2021-01-19T16:29:54.674000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210119_162950/rpc_bind_591
2021-01-19T16:29:54.675000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210119_162950/rpc_bind_591/test_framework.log
2021-01-19T16:29:54.675000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210119_162950/rpc_bind_591' to consolidate all logs

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

This revision is now accepted and ready to land.Jan 19 2021, 18:38