Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnostic message for retried tests #3960

Merged
merged 1 commit into from
Nov 24, 2015
Merged
Changes from all 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
16 changes: 11 additions & 5 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def RunSingle(self, parallel, thread_id):
sys.platform == 'sunos5' and
'ECONNREFUSED' in output.output.stderr):
output = case.Run()
output.diagnostic.append('ECONNREFUSED received, test retried')
case.duration = (datetime.now() - start)
except IOError, e:
return
Expand Down Expand Up @@ -255,6 +256,10 @@ def HasRun(self, output):

class TapProgressIndicator(SimpleProgressIndicator):

def _printDiagnostic(self, messages):
for l in messages.splitlines():
logger.info('# ' + l)

def Starting(self):
logger.info('1..%i' % len(self.cases))
self._done = 0
Expand All @@ -270,14 +275,13 @@ def HasRun(self, output):
if FLAKY in output.test.outcomes and self.flaky_tests_mode == DONTCARE:
status_line = status_line + ' # TODO : Fix flaky test'
logger.info(status_line)
self._printDiagnostic("\n".join(output.diagnostic))

if output.HasTimedOut():
logger.info('# TIMEOUT')
self._printDiagnostic('TIMEOUT')

for l in output.output.stderr.splitlines():
logger.info('#' + l)
for l in output.output.stdout.splitlines():
logger.info('#' + l)
self._printDiagnostic(output.output.stderr)
self._printDiagnostic(output.output.stdout)
else:
skip = skip_regex.search(output.output.stdout)
if skip:
Expand All @@ -288,6 +292,7 @@ def HasRun(self, output):
if FLAKY in output.test.outcomes:
status_line = status_line + ' # TODO : Fix flaky test'
logger.info(status_line)
self._printDiagnostic("\n".join(output.diagnostic))

duration = output.test.duration

Expand Down Expand Up @@ -490,6 +495,7 @@ def __init__(self, test, command, output, store_unexpected_output):
self.command = command
self.output = output
self.store_unexpected_output = store_unexpected_output
self.diagnostic = []

def UnexpectedOutput(self):
if self.HasCrashed():
Expand Down