6 Commits

Author SHA1 Message Date
John Newbery
4d3ba18386 [tests] TestNode: separate add_node from start_node
Separates the act of creating a TestNode object from starting the node.
The test_framework now keeps track of its list of TestNodes, and test
writers can call start_node() and stop_node() without having to update
the self.nodes list.

Github-Pull: #11121
Rebased-From: 36b626867087e9fae6d85f926248997ebff327b7
2017-10-03 18:43:15 +02:00
John Newbery
11a5992c90 [tests] fix - use rpc_timeout as rpc timeout
Github-Pull: #11121
Rebased-From: be2a2ab6a67beef97e3c3cf42bd5eeea6c4e55cf
2017-10-03 18:42:57 +02:00
John Newbery
016b9ada21 [tests] add TestNodeCLI class for calling bitcoin-cli for a node
Github-Pull: #10798
Rebased-From: b23549f6e677a8e22953568704eac7ea0c2c1289
2017-10-03 18:31:40 +02:00
John Newbery
1d80d1e319 [tests] fix timeout issues from TestNode
Fixes a couple of bugs from the introduction of TestNode:

- test scripts were no longer able to specify a custom timeout for
starting a node. Therefore tests with nodes that take a long time to
start up (eg pruning.py) would fail.
- the test for whether a node has failed on start up was broken
by changing 'assert x is None' to 'assert not x'. Since
subprocess.poll() can return None (indicating the node is still running)
or 0 (indicating the node exited with return code 0), this was a
regression.

Github-Pull: #11077
Rebased-From: 2b4ea520b717b3ca894adbac17796786667764d3
2017-10-03 18:29:34 +02:00
Wladimir J. van der Laan
c276c1e1d1 test: Increase initial RPC timeout to 60 seconds
When running the tests locally with a parallelism of 4 on an otherwise
busy system, RPC can take quite a wait to come up.

Change the timeout to 60 seconds just to be safe.

Github-Pull: #11091
Rebased-From: c1470a058f21bf98d83b9dc345c61626b87035cc
2017-10-03 18:23:41 +02:00
John Newbery
fc2aa09cf3 [tests] Introduce TestNode
TestNode is a class responsible for all state related to a bitcoind node
under test. It stores local state, is responsible for tracking the
bitcoind process and delegates unrecognised messages to the RPC
connection.

This commit changes start_nodes and stop_nodes to start and stop the
bitcoind nodes in parallel, making test setup and teardown much faster.

Github-Pull: #10711
Rebased-From: 7897338918dac072e788b8ab2919d4559f311bef
2017-10-03 18:18:17 +02:00