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

Commit

Permalink
Fixed too short timeout and fixed errorExit call.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianjohnson5972 committed Jan 3, 2019
1 parent c494683 commit 0826164
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ def processCleosCmd(self, cmd, cmdDesc, silentErrors=True, exitOnError=False, ex

if exitOnError and trans is None:
Utils.cmdError("could not \"%s\". %s" % (cmdDesc,exitMsg))
errorExit("Failed to \"%s\"" % (cmdDesc))
Utils.errorExit("Failed to \"%s\"" % (cmdDesc))

return trans

Expand Down Expand Up @@ -1210,10 +1210,10 @@ def interruptAndVerifyExitStatus(self):
assert self.popenProc is not None, "node: \"%s\" does not have a popenProc, this may be because it is only set after a relaunch." % (self.cmd)
self.popenProc.send_signal(signal.SIGINT)
try:
outs, _ = self.popenProc.communicate(timeout=0.2)
outs, _ = self.popenProc.communicate(timeout=1)
assert self.popenProc.returncode == 0, "Expected terminating \"%s\" to have an exit status of 0, but got %d" % (self.cmd, self.popenProc.returncode)
except subprocess.TimeoutExpired:
errorExit("Terminate call failed on node: %s" % (self.cmd))
Utils.errorExit("Terminate call failed on node: %s" % (self.cmd))

def verifyAlive(self, silent=False):
if not silent and Utils.Debug: Utils.Print("Checking if node(pid=%s) is alive(killed=%s): %s" % (self.pid, self.killed, self.cmd))
Expand All @@ -1239,7 +1239,7 @@ def getBlockProducerByNum(self, blockNum, timeout=None, waitForBlock=True, exitO
blockProducer=block["producer"]
if blockProducer is None and exitOnError:
Utils.cmdError("could not get producer for block number %s" % (blockNum))
errorExit("Failed to get block's producer")
Utils.errorExit("Failed to get block's producer")
return blockProducer

def getBlockProducer(self, timeout=None, waitForBlock=True, exitOnError=True, blockType=BlockType.head):
Expand All @@ -1248,7 +1248,7 @@ def getBlockProducer(self, timeout=None, waitForBlock=True, exitOnError=True, bl
blockProducer=block["producer"]
if blockProducer is None and exitOnError:
Utils.cmdError("could not get producer for block number %s" % (blockNum))
errorExit("Failed to get block's producer")
Utils.errorExit("Failed to get block's producer")
return blockProducer

def getNextCleanProductionCycle(self, trans):
Expand Down

0 comments on commit 0826164

Please sign in to comment.