Skip to content

Commit

Permalink
GH-2165 Explicit shutdown since atexit not called on error
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Feb 2, 2024
1 parent a131719 commit de910b9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions tests/TestHarness/Cluster.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import atexit
import copy
import subprocess
import time
Expand Down Expand Up @@ -76,7 +75,6 @@ def __init__(self, localCluster=True, host="localhost", port=8888, walletHost="l
keepRunning: [True|False] If true, leave nodes running when Cluster is destroyed. Implies keepLogs.
keepLogs: [True|False] If true, retain log files after cluster shuts down.
"""
atexit.register(self.shutdown)
self.accounts=[]
self.nodes=[]
self.unstartedNodes=[]
Expand Down
2 changes: 2 additions & 0 deletions tests/TestHarness/TestHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,5 @@ def reportProductionAnalysis(thresholdMs):
cluster.testFailed = not testSuccessful
if walletMgr:
walletMgr.testFailed = not testSuccessful

cluster.shutdown()
1 change: 1 addition & 0 deletions tests/trace_plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def setUpClass(self):
@classmethod
def tearDownClass(self):
TraceApiPluginTest.cluster.testFailed = not testSuccessful
TraceApiPluginTest.cluster.shutdown()

if __name__ == "__main__":
unittest.main()

0 comments on commit de910b9

Please sign in to comment.