diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-02-22 11:29:43 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-02-23 03:05:43 +0100 |
commit | fa4cd2e998e0ebebe283a6243f7f752123a105ab (patch) | |
tree | 691fa6bf7ffa07cc0676bba2d5fe21ae6854e08f /qa/rpc-tests/test_framework | |
parent | 8ad31f9aa3111e079dd5024e8f6b069abb564b81 (diff) |
qa: Check return code when stopping nodes
This includes work by jnewbery
Diffstat (limited to 'qa/rpc-tests/test_framework')
-rw-r--r-- | qa/rpc-tests/test_framework/util.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py index dc8555c44c..ec151c2a65 100644 --- a/qa/rpc-tests/test_framework/util.py +++ b/qa/rpc-tests/test_framework/util.py @@ -375,28 +375,19 @@ def stop_node(node, i): node.stop() except http.client.CannotSendRequest as e: print("WARN: Unable to stop node: " + repr(e)) - bitcoind_processes[i].wait(timeout=BITCOIND_PROC_WAIT_TIMEOUT) + return_code = bitcoind_processes[i].wait(timeout=BITCOIND_PROC_WAIT_TIMEOUT) + assert_equal(return_code, 0) del bitcoind_processes[i] def stop_nodes(nodes): - for node in nodes: - try: - node.stop() - except http.client.CannotSendRequest as e: - print("WARN: Unable to stop node: " + repr(e)) - del nodes[:] # Emptying array closes connections as a side effect - wait_bitcoinds() + for i, node in enumerate(nodes): + stop_node(node, i) + assert not bitcoind_processes.values() # All connections must be gone now def set_node_times(nodes, t): for node in nodes: node.setmocktime(t) -def wait_bitcoinds(): - # Wait for all bitcoinds to cleanly exit - for bitcoind in bitcoind_processes.values(): - bitcoind.wait(timeout=BITCOIND_PROC_WAIT_TIMEOUT) - bitcoind_processes.clear() - def connect_nodes(from_connection, node_num): ip_port = "127.0.0.1:"+str(p2p_port(node_num)) from_connection.addnode(ip_port, "onetry") |