keep alive long silent tests, add integer overflow

This commit is contained in:
Alex Groce
2018-07-14 06:27:48 -07:00
parent 8713846044
commit 96fc87f781
3 changed files with 17 additions and 0 deletions
+5
View File
@@ -12,13 +12,18 @@ def logrun(cmd, file, timeout):
p = subprocess.Popen(cmd, stdout=outf, stderr=outf)
start = time.time()
oldContents = ""
lastOutput = time.time()
while (p.poll() is None) and ((time.time() - start) < timeout):
if (time.time() - lastOutput) > 300:
sys.stderr.write("\n\n** FIVE MINUTE KEEPALIVE FROM TEST LOGGING **\n\n")
sys.stderr.flush()
with open(file, 'r') as inf:
contents = inf.read()
if len(contents) > len(oldContents):
sys.stderr.write(contents[len(oldContents):])
sys.stderr.flush()
oldContents = contents
lastOutput = time.time()
time.sleep(0.05)
totalTime = time.time() - start
sys.stderr.write("\n")