Page MenuHomePhabricator

Prevent occasional timeout in feature_assumevalid
ClosedPublic

Authored by Fabien on Thu, Feb 27, 10:05.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCba974a9c5381: Prevent occasional timeout in feature_assumevalid
Summary

The header syncing can take some time on slow machines and offsets the timeout for the block syncing significantly, causing the test to fail to sync in time on some occasion.
This diff waits for the header to sync before starting the timeout which should make the test more robust.

Test Plan
./test/functional/test_runner.py feature_assumevalid

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Thu, Feb 27, 10:05
Fabien planned changes to this revision.Thu, Feb 27, 10:05

Failed tests logs:

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

------- Stdout: -------
2025-02-27T10:09:31.039000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_โ‚ฟโ‚ต_๐Ÿƒ_20250227_100711/feature_assumevalid_43
2025-02-27T10:10:02.484000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
                self.wait_until(lambda: expected in node.getchaintips(), timeout=5)
'''
{'height': 2202, 'hash': '4fc2ca652c150ae87b308d4f4292b6fd0aaeb453406f5a2a49207f7200bd172f', 'branchlen': 2202, 'status': 'headers-only'}
[{'height': 2202, 'hash': '4fc2ca652c150ae87b308d4f4292b6fd0aaeb453406f5a2a49207f7200bd172f', 'branchlen': 2202, 'status': 'headers-only'}, {'height': 0, 'hash': '0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206', 'branchlen': 0, 'status': 'active'}]
2025-02-27T10:10:06.953000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/feature_assumevalid.py", line 160, in wait_for_header_sync
    self.wait_until(lambda: expected in node.getchaintips(), timeout=5)
  File "/work/test/functional/test_framework/test_framework.py", line 874, in wait_until
    return wait_until_helper(
           ^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/util.py", line 296, in wait_until_helper
    raise AssertionError(
AssertionError: Predicate ''''
                self.wait_until(lambda: expected in node.getchaintips(), timeout=5)
''' not true after 5.0 seconds

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/feature_assumevalid.py", line 170, in run_test
    wait_for_header_sync(self.nodes[0], 2202)
  File "/work/test/functional/feature_assumevalid.py", line 164, in wait_for_header_sync
    assert False
AssertionError
2025-02-27T10:10:07.005000Z TestFramework (INFO): Stopping nodes
2025-02-27T10:10:07.211000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_โ‚ฟโ‚ต_๐Ÿƒ_20250227_100711/feature_assumevalid_43
2025-02-27T10:10:07.211000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_โ‚ฟโ‚ต_๐Ÿƒ_20250227_100711/feature_assumevalid_43/test_framework.log
2025-02-27T10:10:07.211000Z TestFramework (ERROR): 
2025-02-27T10:10:07.211000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_โ‚ฟโ‚ต_๐Ÿƒ_20250227_100711/feature_assumevalid_43' to consolidate all logs
2025-02-27T10:10:07.211000Z TestFramework (ERROR): 
2025-02-27T10:10:07.211000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-02-27T10:10:07.214000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-02-27T10:10:07.214000Z TestFramework (ERROR):

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

This revision is now accepted and ready to land.Thu, Feb 27, 10:15

Failed tests logs:

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

------- Stdout: -------
2025-02-27T10:11:41.734000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_โ‚ฟโ‚ต_๐Ÿƒ_20250227_100922/feature_assumevalid_43
2025-02-27T10:11:58.582000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
            self.wait_until(lambda: expected in node.getchaintips(), timeout=5)
'''
2025-02-27T10:11:58.582000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/feature_assumevalid.py", line 165, in run_test
    wait_for_header_sync(self.nodes[0], 2202)
  File "/work/test/functional/feature_assumevalid.py", line 159, in wait_for_header_sync
    self.wait_until(lambda: expected in node.getchaintips(), timeout=5)
  File "/work/test/functional/test_framework/test_framework.py", line 874, in wait_until
    return wait_until_helper(
           ^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/util.py", line 296, in wait_until_helper
    raise AssertionError(
AssertionError: Predicate ''''
            self.wait_until(lambda: expected in node.getchaintips(), timeout=5)
''' not true after 5.0 seconds
2025-02-27T10:11:58.634000Z TestFramework (INFO): Stopping nodes
2025-02-27T10:12:01.449000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_โ‚ฟโ‚ต_๐Ÿƒ_20250227_100922/feature_assumevalid_43
2025-02-27T10:12:01.449000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_โ‚ฟโ‚ต_๐Ÿƒ_20250227_100922/feature_assumevalid_43/test_framework.log
2025-02-27T10:12:01.449000Z TestFramework (ERROR): 
2025-02-27T10:12:01.449000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_โ‚ฟโ‚ต_๐Ÿƒ_20250227_100922/feature_assumevalid_43' to consolidate all logs
2025-02-27T10:12:01.449000Z TestFramework (ERROR): 
2025-02-27T10:12:01.449000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-02-27T10:12:01.449000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-02-27T10:12:01.449000Z TestFramework (ERROR):

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