test: add TAP diagnostic message for retried tests
Tests on SmartOS are sometimes retried due to a SmartOS issue on CI. When this happens, a TAP diagnostic message is written. PR-URL: https://github.com/nodejs/node/pull/3960 Reviewed-By: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
parent
8d37bbe9e9
commit
41519fd1a4
@ -145,6 +145,7 @@ class ProgressIndicator(object):
|
|||||||
sys.platform == 'sunos5' and
|
sys.platform == 'sunos5' and
|
||||||
'ECONNREFUSED' in output.output.stderr):
|
'ECONNREFUSED' in output.output.stderr):
|
||||||
output = case.Run()
|
output = case.Run()
|
||||||
|
output.diagnostic.append('ECONNREFUSED received, test retried')
|
||||||
case.duration = (datetime.now() - start)
|
case.duration = (datetime.now() - start)
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
return
|
return
|
||||||
@ -255,6 +256,10 @@ class DotsProgressIndicator(SimpleProgressIndicator):
|
|||||||
|
|
||||||
class TapProgressIndicator(SimpleProgressIndicator):
|
class TapProgressIndicator(SimpleProgressIndicator):
|
||||||
|
|
||||||
|
def _printDiagnostic(self, messages):
|
||||||
|
for l in messages.splitlines():
|
||||||
|
logger.info('# ' + l)
|
||||||
|
|
||||||
def Starting(self):
|
def Starting(self):
|
||||||
logger.info('1..%i' % len(self.cases))
|
logger.info('1..%i' % len(self.cases))
|
||||||
self._done = 0
|
self._done = 0
|
||||||
@ -270,14 +275,13 @@ class TapProgressIndicator(SimpleProgressIndicator):
|
|||||||
if FLAKY in output.test.outcomes and self.flaky_tests_mode == DONTCARE:
|
if FLAKY in output.test.outcomes and self.flaky_tests_mode == DONTCARE:
|
||||||
status_line = status_line + ' # TODO : Fix flaky test'
|
status_line = status_line + ' # TODO : Fix flaky test'
|
||||||
logger.info(status_line)
|
logger.info(status_line)
|
||||||
|
self._printDiagnostic("\n".join(output.diagnostic))
|
||||||
|
|
||||||
if output.HasTimedOut():
|
if output.HasTimedOut():
|
||||||
logger.info('# TIMEOUT')
|
self._printDiagnostic('TIMEOUT')
|
||||||
|
|
||||||
for l in output.output.stderr.splitlines():
|
self._printDiagnostic(output.output.stderr)
|
||||||
logger.info('#' + l)
|
self._printDiagnostic(output.output.stdout)
|
||||||
for l in output.output.stdout.splitlines():
|
|
||||||
logger.info('#' + l)
|
|
||||||
else:
|
else:
|
||||||
skip = skip_regex.search(output.output.stdout)
|
skip = skip_regex.search(output.output.stdout)
|
||||||
if skip:
|
if skip:
|
||||||
@ -288,6 +292,7 @@ class TapProgressIndicator(SimpleProgressIndicator):
|
|||||||
if FLAKY in output.test.outcomes:
|
if FLAKY in output.test.outcomes:
|
||||||
status_line = status_line + ' # TODO : Fix flaky test'
|
status_line = status_line + ' # TODO : Fix flaky test'
|
||||||
logger.info(status_line)
|
logger.info(status_line)
|
||||||
|
self._printDiagnostic("\n".join(output.diagnostic))
|
||||||
|
|
||||||
duration = output.test.duration
|
duration = output.test.duration
|
||||||
|
|
||||||
@ -490,6 +495,7 @@ class TestOutput(object):
|
|||||||
self.command = command
|
self.command = command
|
||||||
self.output = output
|
self.output = output
|
||||||
self.store_unexpected_output = store_unexpected_output
|
self.store_unexpected_output = store_unexpected_output
|
||||||
|
self.diagnostic = []
|
||||||
|
|
||||||
def UnexpectedOutput(self):
|
def UnexpectedOutput(self):
|
||||||
if self.HasCrashed():
|
if self.HasCrashed():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user