Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Enable cacheopen for the node relaunch
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrianto Lie committed Feb 28, 2019
1 parent 2ca517f commit c3c401b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions tests/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ def kill(self, killSignal):
else:
os.kill(self.pid, killSignal)
except OSError as ex:
Utils.Print("ERROR: Failed to kill node (%d)." % (self.cmd), ex)
Utils.Print("ERROR: Failed to kill node (%s)." % (self.cmd), ex)
return False

# wait for kill validation
Expand Down Expand Up @@ -1365,8 +1365,9 @@ def isNodeAlive():
else:
Utils.Print("ERROR: Node relaunch Failed.")
# Ensure the node process is really killed
self.popenProc.send_signal(signal.SIGTERM)
self.popenProc.wait()
if self.popenProc:
self.popenProc.send_signal(signal.SIGTERM)
self.popenProc.wait()
self.pid=None
return False

Expand Down
4 changes: 2 additions & 2 deletions tests/nodeos_irreversible_mode_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def confirmHeadLibAndForkDbHeadOfSpecMode(nodeToTest, headLibAndForkDbHeadBefore
"Fork db head ({}) should be equal to fork db head before switch mode ({}) ".format(forkDbHead, forkDbHeadBeforeSwitchMode)

def relaunchNode(node: Node, nodeId, chainArg="", addOrSwapFlags=None, relaunchAssertMessage="Fail to relaunch"):
isRelaunchSuccess = node.relaunch(nodeId, chainArg=chainArg, addOrSwapFlags=addOrSwapFlags, timeout=relaunchTimeout)
isRelaunchSuccess = node.relaunch(nodeId, chainArg=chainArg, addOrSwapFlags=addOrSwapFlags, timeout=relaunchTimeout, cachePopen=True)
assert isRelaunchSuccess, relaunchAssertMessage
return isRelaunchSuccess

Expand Down Expand Up @@ -153,7 +153,7 @@ def stopProdNode():

def startProdNode():
if producingNode.killed:
producingNode.relaunch(producingNodeId, "", timeout=relaunchTimeout)
relaunchNode(producingNode, producingNodeId)

# Give some time for it to produce, so lib is advancing
waitForBlksProducedAndLibAdvanced()
Expand Down

0 comments on commit c3c401b

Please sign in to comment.