Skip to content

Commit

Permalink
Merge pull request #2192 from AntelopeIO/GH-2165-cluster-shutdown
Browse files Browse the repository at this point in the history
Tests: Explicit shutdown since atexit not called on error
  • Loading branch information
heifner authored Feb 3, 2024
2 parents a131719 + de910b9 commit 6fb3fe6
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 6fb3fe6

Please sign in to comment.