Skip to content

Commit fafb33c

Browse files
author
MarcoFalke
committed
[qa] Stop other nodes, even when one fails to stop
1 parent 2222dae commit fafb33c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

qa/rpc-tests/test_framework/util.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from base64 import b64encode
1717
from decimal import Decimal, ROUND_DOWN
1818
import json
19+
import http.client
1920
import random
2021
import shutil
2122
import subprocess
@@ -316,13 +317,19 @@ def log_filename(dirname, n_node, logname):
316317
return os.path.join(dirname, "node"+str(n_node), "regtest", logname)
317318

318319
def stop_node(node, i):
319-
node.stop()
320+
try:
321+
node.stop()
322+
except http.client.CannotSendRequest as e:
323+
print("WARN: Unable to stop node: " + repr(e))
320324
bitcoind_processes[i].wait()
321325
del bitcoind_processes[i]
322326

323327
def stop_nodes(nodes):
324328
for node in nodes:
325-
node.stop()
329+
try:
330+
node.stop()
331+
except http.client.CannotSendRequest as e:
332+
print("WARN: Unable to stop node: " + repr(e))
326333
del nodes[:] # Emptying array closes connections as a side effect
327334

328335
def set_node_times(nodes, t):

0 commit comments

Comments
 (0)