Page MenuHomePhabricator

[tests] Update start/stop node functions to be private module functions
ClosedPublic

Authored by deadalnix on Jan 20 2018, 19:25.

Details

Summary

This commit marks the start/stop functions in util.py as private module
functions. A future PR will remove these entirely and move the
functionality directly into the BitcoinTestFramework class, but setting them as
private in this PR will prevent anyone from accidentally calling them
before that future PR is merged.

This ends the backport of core's PR10359

This was also amended to prt the test thatare specific to ABC.

Depends on D991
Closes T149

Test Plan
make check
./test/functional/test_runner.py --extended

Diff Detail

Repository
rABC Bitcoin ABC
Branch
startstopprivate
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 1711
Build 1711: arc lint + arc unit

Event Timeline

OK, I see that some changes from
https://github.com/bitcoin/bitcoin/pull/10359/files
are already applied current master 9e9e088: like abandonconflict.py
https://github.com/bitcoin/bitcoin/pull/10359/files#diff-401ca62066f6793c4c39811aea5fdcc8R76

I grep'ed with the Diff applied; and it seems we should remove

start_nodes,

at https://github.com/Bitcoin-ABC/bitcoin-abc/blob/master/test/functional/zmq_test.py#L16

(That change is not on PR10359)

I run --the extended test locally and I got 2 failed tests:

fundrawtransaction.py          | Failed | 36s
zmq_test.py                    | Failed | 0s
fundrawtransaction.py:
2018-01-21 17:44:14.313000 TestFramework (INFO): Initializing test directory /var/folders/x8/hdljhnjn42j45qy5jzjc2sn40000gp/T/testfma6sjjx/393
2018-01-21 17:44:43.075000 TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/Users/ematiu/dev/bitcoin-abc/test/functional/test_framework/util.py", line 346, in _start_nodes
    i, dirname, extra_args[i], rpchost, timewait=timewait, binary=binary[i]))
  File "/Users/ematiu/dev/bitcoin-abc/test/functional/test_framework/util.py", line 298, in _start_node
    wait_for_bitcoind_start(bitcoind_processes[i], url, i)
  File "/Users/ematiu/dev/bitcoin-abc/test/functional/test_framework/util.py", line 243, in wait_for_bitcoind_start
    'bitcoind exited with status %i during initialization' % process.returncode)
Exception: bitcoind exited with status 1 during initialization

and

zmq_test.py:

stderr:
Traceback (most recent call last):
  File "/Users/ematiu/dev/bitcoin-abc/build/../test/functional/zmq_test.py", line 13, in <module>
    from test_framework.util import (
ImportError: cannot import name 'start_nodes'
matiu requested changes to this revision.Jan 21 2018, 17:50
This revision now requires changes to proceed.Jan 21 2018, 17:50

Rebase and make sure fundrawtransaction and zmq_test are passing.

This revision is now accepted and ready to land.Jan 21 2018, 20:38