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

Extend shutdown allowed time in under min available resources test #8306

Merged
merged 3 commits into from
Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tests/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,9 @@ def interruptAndVerifyExitStatus(self, timeout=60):
self.killed=True

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))
logStatus=not silent and Utils.Debug
pid=self.pid
if logStatus: Utils.Print("Checking if node(pid=%s) is alive(killed=%s): %s" % (self.pid, self.killed, self.cmd))
if self.killed or self.pid is None:
self.killed=True
self.pid=None
Expand All @@ -1375,10 +1377,13 @@ def verifyAlive(self, silent=False):
# mark node as killed
self.pid=None
self.killed=True
if logStatus: Utils.Print("Determined node(formerly pid=%s) is killed" % (pid))
return False
except PermissionError as ex:
if logStatus: Utils.Print("Determined node(formerly pid=%s) is killed" % (pid))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should say "is alive", right?

return True

if logStatus: Utils.Print("Determined node(pid=%s) is alive (kill command executed)" % (self.pid))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't call kill, well technically it did, but the kill is kill 0 which is just check the status. I think you should remove "(kill command executed)"

return True

def getBlockProducerByNum(self, blockNum, timeout=None, waitForBlock=True, exitOnError=True):
Expand Down
12 changes: 5 additions & 7 deletions tests/nodeos_under_min_avail_ram.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,19 @@
errorExit("Incorrect number of store actions sent")

# Make sure all the nodes are shutdown (may take a little while for this to happen, so making multiple passes)
allDone=False
count=0
while not allDone:
while True:
allDone=True
for node in nodes:
if node.verifyAlive():
allDone=False
if not allDone:
time.sleep(5)
if allDone:
break
count+=1
if count>5:
if count>12:
Utils.cmdError("All Nodes should have died")
errorExit("Failure - All Nodes should have died")
time.sleep(5)

for i in range(numNodes):
f = open(Utils.getNodeDataDir(i) + "/stderr.txt")
Expand Down Expand Up @@ -268,7 +268,6 @@
addSwapFlags={}

time.sleep(10)
allDone=True
for node in nodes:
if not node.verifyAlive():
Utils.cmdError("All Nodes should be alive")
Expand Down Expand Up @@ -305,7 +304,6 @@

time.sleep(10)
Print("Check nodes are alive")
allDone=True
for node in nodes:
if not node.verifyAlive():
Utils.cmdError("All Nodes should be alive")
Expand Down