Commit f4ebbb3f authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[test] Let fuzzer total timeout also stop the execution loop

TBR=sergiyb@chromium.org

Bug: v8:6917
Change-Id: I5bc8f49dc01d98949e3efab01192c663de8027bf
Reviewed-on: https://chromium-review.googlesource.com/888578
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50887}
parent 35bce874
...@@ -177,6 +177,7 @@ class CombinedTest(testcase.TestCase): ...@@ -177,6 +177,7 @@ class CombinedTest(testcase.TestCase):
self._tests = tests self._tests = tests
def _prepare_outcomes(self, force_update=True): def _prepare_outcomes(self, force_update=True):
# We tolerate timeout with combined tests.
self._statusfile_outcomes = outproc.OUTCOMES_PASS_OR_TIMEOUT self._statusfile_outcomes = outproc.OUTCOMES_PASS_OR_TIMEOUT
self.expected_outcomes = outproc.OUTCOMES_PASS_OR_TIMEOUT self.expected_outcomes = outproc.OUTCOMES_PASS_OR_TIMEOUT
......
...@@ -94,9 +94,12 @@ class TestProc(object): ...@@ -94,9 +94,12 @@ class TestProc(object):
self._prev_proc.heartbeat() self._prev_proc.heartbeat()
def stop(self): def stop(self):
if not self._stopped:
self._stopped = True self._stopped = True
if self._prev_proc: if self._prev_proc:
self._prev_proc.stop() self._prev_proc.stop()
if self._next_proc:
self._next_proc.stop()
@property @property
def is_stopped(self): def is_stopped(self):
......
...@@ -65,6 +65,8 @@ class ExecutionProc(base.TestProc): ...@@ -65,6 +65,8 @@ class ExecutionProc(base.TestProc):
) )
for pool_result in it: for pool_result in it:
if pool_result.heartbeat: if pool_result.heartbeat:
if self.is_stopped:
break
continue continue
job_result = pool_result.value job_result = pool_result.value
...@@ -73,6 +75,11 @@ class ExecutionProc(base.TestProc): ...@@ -73,6 +75,11 @@ class ExecutionProc(base.TestProc):
test, result.cmd = self._tests[test_id] test, result.cmd = self._tests[test_id]
del self._tests[test_id] del self._tests[test_id]
self._send_result(test, result) self._send_result(test, result)
if self.is_stopped:
# Stop first after sending the current result to not waste it.
break
except KeyboardInterrupt: except KeyboardInterrupt:
raise raise
except: except:
......
...@@ -34,7 +34,7 @@ class RerunProc(base.TestProcProducer): ...@@ -34,7 +34,7 @@ class RerunProc(base.TestProcProducer):
results = self._results[test.procid] results = self._results[test.procid]
results.append(result) results.append(result)
if self._needs_rerun(test, result): if not self.is_stopped and self._needs_rerun(test, result):
self._rerun[test.procid] += 1 self._rerun[test.procid] += 1
if self._rerun_total_left is not None: if self._rerun_total_left is not None:
self._rerun_total_left -= 1 self._rerun_total_left -= 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment