Page MenuHomePhabricator

Move parse_args and set_test_params to __init__
ClosedPublic

Authored by PiRK on Nov 3 2020, 10:25.

Details

Reviewers
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC1c71a7fb0e16: Move parse_args and set_test_params to __init__
Summary

This ensures TestFramework default parameters are set before setup is called.
A child class will therefore have access to defaults when overriding setup.

In our codebase, this was already achieved by the change in D1974 which move d`set_test_params` into main() after parsing arguments. This commit makes our codebase more similar to Core, while keeping our ordering of method calls: parse_args before set_test_params.

This is a backport of Core PR17288 [5/7]

It is inspired by the following 2 commits while taking into account changes introduced in D1974:

Depends on D8244

Test Plan

ninja && ninja check

Event Timeline

Owners added a reviewer: Restricted Owners Package.Nov 3 2020, 10:25
PiRK requested review of this revision.Nov 3 2020, 10:25
This revision is now accepted and ready to land.Nov 3 2020, 11:01

Failed tests logs:

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

------- Stdout: -------
2020-11-03T11:01:48.796000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20201103_110146/rpc_bind_405
2020-11-03T11:01:48.797000Z TestFramework (INFO): Check for linux
2020-11-03T11:01:48.829000Z TestFramework (INFO): Check for ipv6
2020-11-03T11:01:48.829000Z TestFramework (INFO): Check for non-loopback interface
2020-11-03T11:01:48.830000Z TestFramework (INFO): Bind test for []
2020-11-03T11:01:49.568000Z TestFramework (INFO): Bind test for []
2020-11-03T11:01:50.972000Z TestFramework (INFO): Bind test for ['[::1]']
2020-11-03T11:01:51.695000Z TestFramework (INFO): Bind test for ['127.0.0.1', '[::1]']
2020-11-03T11:01:52.226000Z TestFramework (INFO): Using interface 172.17.0.2 for testing
2020-11-03T11:01:52.227000Z TestFramework (INFO): Bind test for ['172.17.0.2']
2020-11-03T11:01:52.498000Z 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 135, in run_test
    self._run_nonloopback_tests()
  File "/work/test/functional/rpc_bind.py", line 170, in _run_nonloopback_tests
    [(self.non_loopback_ip, self.defaultport)])
  File "/work/test/functional/rpc_bind.py", line 71, 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/6894/fd/17'
2020-11-03T11:01:52.549000Z TestFramework (INFO): Stopping nodes
2020-11-03T11:01:52.751000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20201103_110146/rpc_bind_405
2020-11-03T11:01:52.751000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20201103_110146/rpc_bind_405/test_framework.log
2020-11-03T11:01:52.751000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20201103_110146/rpc_bind_405' to consolidate all logs

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