Skip to content

Commit

Permalink
GH-13 Remove dup code
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Apr 23, 2024
1 parent cf54b7a commit 196ccc0
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions tests/disaster_recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,11 @@
node0.waitForLibToAdvance()
node1.waitForLibToAdvance()

node1.kill(signal.SIGTERM)
node2.kill(signal.SIGTERM)
node3.kill(signal.SIGTERM)
for node in [node1, node2, node3]:
node.kill(signal.SIGTERM)

assert not node1.verifyAlive(), "Node1 did not shutdown"
assert not node2.verifyAlive(), "Node2 did not shutdown"
assert not node3.verifyAlive(), "Node3 did not shutdown"
for node in [node1, node2, node3]:
assert not node.verifyAlive(), "Node did not shutdown"

# node0 will have higher lib than 1,2,3 since it can incorporate QCs in blocks
Print("Wait for node 0 head to advance")
Expand All @@ -92,19 +90,12 @@
node.removeReversibleBlks()
node.removeState()

isRelaunchSuccess = node0.relaunch(chainArg=" --snapshot {}".format(node0.getLatestSnapshot()))
assert isRelaunchSuccess, "node 0 relaunch from snapshot failed"
isRelaunchSuccess = node1.relaunch(chainArg=" --snapshot {}".format(node0.getLatestSnapshot()))
assert isRelaunchSuccess, "node 1 relaunch from snapshot failed"
isRelaunchSuccess = node2.relaunch(chainArg=" --snapshot {}".format(node0.getLatestSnapshot()))
assert isRelaunchSuccess, "node 2 relaunch from snapshot failed"
isRelaunchSuccess = node3.relaunch(chainArg=" --snapshot {}".format(node0.getLatestSnapshot()))
assert isRelaunchSuccess, "node 3 relaunch from snapshot failed"
for i in range(4):
isRelaunchSuccess = cluster.getNode(i).relaunch(chainArg=" --snapshot {}".format(node0.getLatestSnapshot()))
assert isRelaunchSuccess, f"node {i} relaunch from snapshot failed"

node0.waitForLibToAdvance()
node1.waitForLibToAdvance()
node2.waitForLibToAdvance()
node3.waitForLibToAdvance()
for node in [node0, node1, node2, node3]:
node.waitForLibToAdvance()

testSuccessful=True
finally:
Expand Down

0 comments on commit 196ccc0

Please sign in to comment.