Page MenuHomePhabricator

test: Move test framework specific constants from messages.py to p2p.py
ClosedPublic

Authored by PiRK on Jan 31 2022, 16:55.

Details

Summary

The messages.py module should contain code and helpers for
[de]serializing p2p messages. Specific usage of those messages should
be in p2p.py. This PR moves test framework specific constants to p2p.py.

This is a backport of core#20524
Depends on D10943

Test Plan

ninja check-functional-extended

Diff Detail

Event Timeline

PiRK requested review of this revision.Jan 31 2022, 16:55

fix abc-version-message.py

Failed tests logs:

====== Bitcoin ABC functional tests: abc-version-message.py ======

------- Stdout: -------
2022-01-31T17:07:24.544000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220131_170544/abc-version-message_136
2022-01-31T17:07:24.951000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/work/test/functional/abc-version-message.py", line 45, in run_test
    ModifiedVersionTimestampP2PInterface(-9223372036854775807), send_version=False)
  File "/work/test/functional/test_framework/test_node.py", line 718, in add_p2p_connection
    assert_equal(self.getpeerinfo()[-1]['subver'], P2P_SUBVERSION)
  File "/work/test/functional/test_framework/util.py", line 60, in assert_equal
    for arg in (thing1, thing2) + args)))
AssertionError: not( == /python-p2p-tester:0.0.3/)
2022-01-31T17:07:25.002000Z TestFramework (INFO): Stopping nodes
2022-01-31T17:07:25.254000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220131_170544/abc-version-message_136
2022-01-31T17:07:25.254000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220131_170544/abc-version-message_136/test_framework.log
2022-01-31T17:07:25.254000Z TestFramework (ERROR): 
2022-01-31T17:07:25.254000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220131_170544/abc-version-message_136' to consolidate all logs
2022-01-31T17:07:25.254000Z TestFramework (ERROR): 
2022-01-31T17:07:25.254000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2022-01-31T17:07:25.254000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2022-01-31T17:07:25.254000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc-version-message.py

PiRK retitled this revision from test: Move MIN_VERSION_SUPPORTED to p2p.py to test: Move test framework specific constants from messages.py to p2p.py.Jan 31 2022, 17:08

Failed tests logs:

====== Bitcoin ABC functional tests: abc-version-message.py ======

------- Stdout: -------
2022-01-31T17:11:59.079000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20220131_170635/abc-version-message_136
2022-01-31T17:11:59.769000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/work/test/functional/abc-version-message.py", line 45, in run_test
    ModifiedVersionTimestampP2PInterface(-9223372036854775807), send_version=False)
  File "/work/test/functional/test_framework/test_node.py", line 718, in add_p2p_connection
    assert_equal(self.getpeerinfo()[-1]['subver'], P2P_SUBVERSION)
  File "/work/test/functional/test_framework/util.py", line 60, in assert_equal
    for arg in (thing1, thing2) + args)))
AssertionError: not( == /python-p2p-tester:0.0.3/)
2022-01-31T17:11:59.820000Z TestFramework (INFO): Stopping nodes
2022-01-31T17:12:00.072000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20220131_170635/abc-version-message_136
2022-01-31T17:12:00.072000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20220131_170635/abc-version-message_136/test_framework.log
2022-01-31T17:12:00.072000Z TestFramework (ERROR): 
2022-01-31T17:12:00.072000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20220131_170635/abc-version-message_136' to consolidate all logs
2022-01-31T17:12:00.072000Z TestFramework (ERROR): 
2022-01-31T17:12:00.072000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2022-01-31T17:12:00.072000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2022-01-31T17:12:00.072000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc-version-message.py

Fabien requested changes to this revision.Jan 31 2022, 17:14
Fabien added a subscriber: Fabien.
Fabien added inline comments.
test/functional/test_framework/messages.py
334 ↗(On Diff #32085)

That's not in the source material, why is that needed ?

1303 ↗(On Diff #32085)

nRelay => relay

test/functional/test_framework/p2p.py
82 ↗(On Diff #32085)

We should bump to 70016, but let this for another diff

This revision now requires changes to proceed.Jan 31 2022, 17:14

Failed tests logs:

====== Bitcoin ABC functional tests: abc-version-message.py ======

------- Stdout: -------
2022-01-31T17:09:50.644000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220131_170616/abc-version-message_136
2022-01-31T17:09:51.562000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/work/test/functional/abc-version-message.py", line 45, in run_test
    ModifiedVersionTimestampP2PInterface(-9223372036854775807), send_version=False)
  File "/work/test/functional/test_framework/test_node.py", line 718, in add_p2p_connection
    assert_equal(self.getpeerinfo()[-1]['subver'], P2P_SUBVERSION)
  File "/work/test/functional/test_framework/util.py", line 60, in assert_equal
    for arg in (thing1, thing2) + args)))
AssertionError: not( == /python-p2p-tester:0.0.3/)
2022-01-31T17:09:51.614000Z TestFramework (INFO): Stopping nodes
2022-01-31T17:09:51.968000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220131_170616/abc-version-message_136
2022-01-31T17:09:51.968000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220131_170616/abc-version-message_136/test_framework.log
2022-01-31T17:09:51.968000Z TestFramework (ERROR): 
2022-01-31T17:09:51.968000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220131_170616/abc-version-message_136' to consolidate all logs
2022-01-31T17:09:51.968000Z TestFramework (ERROR): 
2022-01-31T17:09:51.968000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2022-01-31T17:09:51.968000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2022-01-31T17:09:51.968000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests with the next upgrade activated: abc-version-message.py ======

------- Stdout: -------
2022-01-31T17:13:37.256000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220131_171011/abc-version-message_136
2022-01-31T17:13:37.660000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/work/test/functional/abc-version-message.py", line 45, in run_test
    ModifiedVersionTimestampP2PInterface(-9223372036854775807), send_version=False)
  File "/work/test/functional/test_framework/test_node.py", line 718, in add_p2p_connection
    assert_equal(self.getpeerinfo()[-1]['subver'], P2P_SUBVERSION)
  File "/work/test/functional/test_framework/util.py", line 60, in assert_equal
    for arg in (thing1, thing2) + args)))
AssertionError: not( == /python-p2p-tester:0.0.3/)
2022-01-31T17:13:37.711000Z TestFramework (INFO): Stopping nodes
2022-01-31T17:13:37.963000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220131_171011/abc-version-message_136
2022-01-31T17:13:37.963000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220131_171011/abc-version-message_136/test_framework.log
2022-01-31T17:13:37.963000Z TestFramework (ERROR): 
2022-01-31T17:13:37.963000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220131_171011/abc-version-message_136' to consolidate all logs
2022-01-31T17:13:37.963000Z TestFramework (ERROR): 
2022-01-31T17:13:37.963000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2022-01-31T17:13:37.963000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2022-01-31T17:13:37.963000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc-version-message.py
Bitcoin ABC functional tests with the next upgrade activated: abc-version-message.py

test/functional/test_framework/messages.py
334 ↗(On Diff #32085)

I meant to delete "nVersion" (which core forgot to do), but I guess something went wrong in a rebase

test/functional/test_framework/messages.py
334 ↗(On Diff #32085)

Or maybe nVersion was kept intentionaly to allow users to set the value after init? I will keep it, just in case. Even if serialization and deserialization ignore it, it is still part of the network message.

This revision is now accepted and ready to land.Jan 31 2022, 17:36
This revision was landed with ongoing or failed builds.Jan 31 2022, 17:41
This revision was automatically updated to reflect the committed changes.