Page MenuHomePhabricator

[avalanche] Fix incomplete testing of contenders when staking rewards are active
Changes PlannedPublic

Authored by roqqit on Sun, Apr 27, 02:05.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

D17997 erroneously asserts ACCEPTED for all contenders which is obviously wrong. I mistakenly assumed the contenders test was being run on the diff but it turns out contenders just barely exceeds the cutoff timing.

This diff fixes the cases where staking rewards are active and correctly tests the expected response for each contender.

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

And have the bot run extended tests on this diff.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
sc-fix-sr-lw-case
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33123
Build 65729: Build Diffbuild-without-wallet · build-clang-tidy · build-clang · build-diff · build-debug
Build 65728: arc lint + arc unit

Event Timeline

roqqit requested review of this revision.Sun, Apr 27, 02:05

Failed tests logs:

====== Bitcoin ABC extended functional tests: abc_p2p_avalanche_contender_voting.py ======

------- Stdout: -------
2025-04-27T02:07:43.384000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_020741_1020/abc_p2p_avalanche_contender_voting_10
2025-04-27T02:07:56.648000Z TestFramework (INFO): Check votes after contender promotion
2025-04-27T02:08:06.118000Z TestFramework (INFO): Check votes after staking rewards have been computed
2025-04-27T02:08:06.283000Z TestFramework (INFO): Vote on contenders: manual winner + local winner
2025-04-27T02:08:16.559000Z TestFramework (INFO): Vote on contenders: local winner only
2025-04-27T02:08:20.605000Z TestFramework (INFO): Vote on contenders: 1 winner(s) other than local winner
2025-04-27T02:08:25.293000Z TestFramework (INFO): Vote on contenders: 2 winner(s) other than local winner
2025-04-27T02:08:29.770000Z TestFramework (INFO): Vote on contenders: 3 winner(s) other than local winner
2025-04-27T02:08:34.932000Z TestFramework (INFO): Vote on contenders: zero winners
2025-04-27T02:08:45.004000Z TestFramework (INFO): Vote on contenders: stale contenders
2025-04-27T02:08:50.825000Z TestFramework (INFO): Check votes after node restart
2025-04-27T02:09:07.649000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 152, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 142, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 553, in run_test
    assert_contender_polls(tip, get_all_contender_ids(tip))
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 546, in assert_contender_polls
    assert_response(
  File "/work/test/functional/test_framework/avatools.py", line 532, in assert_response
    assert_equal(repr(votes[i]), repr(expected[i]))
  File "/work/test/functional/test_framework/util.py", line 56, in assert_equal
    raise AssertionError(
AssertionError: not(AvalancheVote(error=0, hash=bc8e8b58064f005b122187f478c0f89a7bd056abadf0f2ea4fbda27bd6759561) == AvalancheVote(error=1, hash=bc8e8b58064f005b122187f478c0f89a7bd056abadf0f2ea4fbda27bd6759561))
2025-04-27T02:09:07.652000Z TestFramework (INFO): Stopping nodes
2025-04-27T02:09:07.804000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_020741_1020/abc_p2p_avalanche_contender_voting_10
2025-04-27T02:09:07.804000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_020741_1020/abc_p2p_avalanche_contender_voting_10/test_framework.log
2025-04-27T02:09:07.804000Z TestFramework (ERROR): 
2025-04-27T02:09:07.804000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_020741_1020/abc_p2p_avalanche_contender_voting_10' to consolidate all logs
2025-04-27T02:09:07.804000Z TestFramework (ERROR): 
2025-04-27T02:09:07.804000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-04-27T02:09:07.804000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-04-27T02:09:07.804000Z TestFramework (ERROR):
====== Bitcoin ABC extended functional tests with the next upgrade activated: abc_p2p_avalanche_contender_voting.py ======

------- Stdout: -------
2025-04-27T02:31:01.213000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_023059_24440/abc_p2p_avalanche_contender_voting_10
2025-04-27T02:31:08.561000Z TestFramework (INFO): Check votes after contender promotion
2025-04-27T02:31:14.307000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 152, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 142, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 247, in run_test
    self.wait_until(lambda: find_polled_contenders())
  File "/work/test/functional/test_framework/test_framework.py", line 890, in wait_until
    return wait_until_helper(
           ^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/util.py", line 302, in wait_until_helper
    if predicate():
       ^^^^^^^^^^^
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 247, in <lambda>
    self.wait_until(lambda: find_polled_contenders())
                            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 237, in find_polled_contenders
    assert_equal(len(polled_contenders), 12)
  File "/work/test/functional/test_framework/util.py", line 56, in assert_equal
    raise AssertionError(
AssertionError: not(1 == 12)
2025-04-27T02:31:14.359000Z TestFramework (INFO): Stopping nodes
2025-04-27T02:31:14.460000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_023059_24440/abc_p2p_avalanche_contender_voting_10
2025-04-27T02:31:14.460000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_023059_24440/abc_p2p_avalanche_contender_voting_10/test_framework.log
2025-04-27T02:31:14.460000Z TestFramework (ERROR): 
2025-04-27T02:31:14.460000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_023059_24440/abc_p2p_avalanche_contender_voting_10' to consolidate all logs
2025-04-27T02:31:14.460000Z TestFramework (ERROR): 
2025-04-27T02:31:14.460000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-04-27T02:31:14.460000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-04-27T02:31:14.460000Z TestFramework (ERROR):

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

roqqit planned changes to this revision.Sun, Apr 27, 03:00

Failed tests logs:

====== Bitcoin ABC extended functional tests: abc_p2p_avalanche_contender_voting.py ======

------- Stdout: -------
2025-04-27T03:09:17.082000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_030914_56865/abc_p2p_avalanche_contender_voting_10
2025-04-27T03:09:34.443000Z TestFramework (INFO): Check votes after contender promotion
2025-04-27T03:09:45.338000Z TestFramework (INFO): Check votes after staking rewards have been computed
2025-04-27T03:09:45.522000Z TestFramework (INFO): Vote on contenders: manual winner + local winner
2025-04-27T03:09:49.865000Z TestFramework (INFO): Vote on contenders: local winner only
2025-04-27T03:09:54.788000Z TestFramework (INFO): Vote on contenders: 1 winner(s) other than local winner
2025-04-27T03:09:59.783000Z TestFramework (INFO): Vote on contenders: 2 winner(s) other than local winner
2025-04-27T03:10:05.569000Z TestFramework (INFO): Vote on contenders: 3 winner(s) other than local winner
2025-04-27T03:10:11.673000Z TestFramework (INFO): Vote on contenders: zero winners
2025-04-27T03:10:22.784000Z TestFramework (INFO): Vote on contenders: stale contenders
2025-04-27T03:10:30.110000Z TestFramework (INFO): Check votes after node restart
2025-04-27T03:11:03.231000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 152, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 142, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 553, in run_test
    assert_contender_polls(tip, get_all_contender_ids(tip))
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 546, in assert_contender_polls
    assert_response(
  File "/work/test/functional/test_framework/avatools.py", line 532, in assert_response
    assert_equal(repr(votes[i]), repr(expected[i]))
  File "/work/test/functional/test_framework/util.py", line 56, in assert_equal
    raise AssertionError(
AssertionError: not(AvalancheVote(error=0, hash=ee27118bd40c641fb238adc3d7ea86980439af7be9dd8503d9293698632bc7eb) == AvalancheVote(error=1, hash=ee27118bd40c641fb238adc3d7ea86980439af7be9dd8503d9293698632bc7eb))
2025-04-27T03:11:03.236000Z TestFramework (INFO): Stopping nodes
2025-04-27T03:11:03.338000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_030914_56865/abc_p2p_avalanche_contender_voting_10
2025-04-27T03:11:03.338000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_030914_56865/abc_p2p_avalanche_contender_voting_10/test_framework.log
2025-04-27T03:11:03.338000Z TestFramework (ERROR): 
2025-04-27T03:11:03.338000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_030914_56865/abc_p2p_avalanche_contender_voting_10' to consolidate all logs
2025-04-27T03:11:03.338000Z TestFramework (ERROR): 
2025-04-27T03:11:03.338000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-04-27T03:11:03.338000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-04-27T03:11:03.339000Z TestFramework (ERROR):
====== Bitcoin ABC extended functional tests with the next upgrade activated: abc_p2p_avalanche_contender_voting.py ======

------- Stdout: -------
2025-04-27T03:34:15.791000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_033414_30330/abc_p2p_avalanche_contender_voting_10
2025-04-27T03:34:23.864000Z TestFramework (INFO): Check votes after contender promotion
2025-04-27T03:34:31.715000Z TestFramework (INFO): Check votes after staking rewards have been computed
2025-04-27T03:34:32.049000Z TestFramework (INFO): Vote on contenders: manual winner + local winner
2025-04-27T03:34:34.539000Z TestFramework (INFO): Vote on contenders: local winner only
2025-04-27T03:34:37.585000Z TestFramework (INFO): Vote on contenders: 1 winner(s) other than local winner
2025-04-27T03:34:40.003000Z TestFramework (INFO): Vote on contenders: 2 winner(s) other than local winner
2025-04-27T03:34:42.880000Z TestFramework (INFO): Vote on contenders: 3 winner(s) other than local winner
2025-04-27T03:34:45.819000Z TestFramework (INFO): Vote on contenders: zero winners
2025-04-27T03:34:48.620000Z TestFramework (INFO): Vote on contenders: stale contenders
2025-04-27T03:34:52.275000Z TestFramework (INFO): Check votes after node restart
2025-04-27T03:35:06.207000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 152, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 142, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 553, in run_test
    assert_contender_polls(tip, get_all_contender_ids(tip))
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 546, in assert_contender_polls
    assert_response(
  File "/work/test/functional/test_framework/avatools.py", line 532, in assert_response
    assert_equal(repr(votes[i]), repr(expected[i]))
  File "/work/test/functional/test_framework/util.py", line 56, in assert_equal
    raise AssertionError(
AssertionError: not(AvalancheVote(error=0, hash=d8d8afbcc2914b07a30d0ebcd39ad0c7e0c16f72d2cb5b2ed3f42fb6b844e1c8) == AvalancheVote(error=1, hash=d8d8afbcc2914b07a30d0ebcd39ad0c7e0c16f72d2cb5b2ed3f42fb6b844e1c8))
2025-04-27T03:35:06.260000Z TestFramework (INFO): Stopping nodes
2025-04-27T03:35:06.370000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_033414_30330/abc_p2p_avalanche_contender_voting_10
2025-04-27T03:35:06.370000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_033414_30330/abc_p2p_avalanche_contender_voting_10/test_framework.log
2025-04-27T03:35:06.370000Z TestFramework (ERROR): 
2025-04-27T03:35:06.370000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-master/test/tmp/test_runner_₿₵_🏃_20250427_033414_30330/abc_p2p_avalanche_contender_voting_10' to consolidate all logs
2025-04-27T03:35:06.370000Z TestFramework (ERROR): 
2025-04-27T03:35:06.370000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-04-27T03:35:06.371000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-04-27T03:35:06.371000Z TestFramework (ERROR):

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