Fix result status of rerun flaky tests.

Tests that pass on reruns where wrongly treated as failures. Now the result state can include any of (PASS, FAIL, CRASH, TIMEOUT)

BUG=374134
LOG=n
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/363883003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22186 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 34eb0262
...@@ -322,6 +322,7 @@ class JsonTestProgressIndicator(ProgressIndicator): ...@@ -322,6 +322,7 @@ class JsonTestProgressIndicator(ProgressIndicator):
# Omit tests that pass on the first run, but collect output of tests # Omit tests that pass on the first run, but collect output of tests
# that pass when rerun. # that pass when rerun.
return return
self.results.append({ self.results.append({
"name": test.GetLabel(), "name": test.GetLabel(),
"flags": test.flags, "flags": test.flags,
...@@ -331,7 +332,7 @@ class JsonTestProgressIndicator(ProgressIndicator): ...@@ -331,7 +332,7 @@ class JsonTestProgressIndicator(ProgressIndicator):
"stdout": test.output.stdout, "stdout": test.output.stdout,
"stderr": test.output.stderr, "stderr": test.output.stderr,
"exit_code": test.output.exit_code, "exit_code": test.output.exit_code,
"result": "CRASH" if test.output.HasCrashed() else "FAIL", "result": test.suite.GetOutcome(test),
}) })
......
...@@ -190,18 +190,19 @@ class TestSuite(object): ...@@ -190,18 +190,19 @@ class TestSuite(object):
else: else:
return execution_failed return execution_failed
def HasUnexpectedOutput(self, testcase): def GetOutcome(self, testcase):
if testcase.output.HasCrashed(): if testcase.output.HasCrashed():
outcome = statusfile.CRASH return statusfile.CRASH
elif testcase.output.HasTimedOut(): elif testcase.output.HasTimedOut():
outcome = statusfile.TIMEOUT return statusfile.TIMEOUT
elif self.HasFailed(testcase): elif self.HasFailed(testcase):
outcome = statusfile.FAIL return statusfile.FAIL
else: else:
outcome = statusfile.PASS return statusfile.PASS
if not testcase.outcomes:
return outcome != statusfile.PASS def HasUnexpectedOutput(self, testcase):
return not outcome in testcase.outcomes outcome = self.GetOutcome(testcase)
return not outcome in (testcase.outcomes or [statusfile.PASS])
def StripOutputForTransmit(self, testcase): def StripOutputForTransmit(self, testcase):
if not self.HasUnexpectedOutput(testcase): if not self.HasUnexpectedOutput(testcase):
......
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