Skip to content

Commit

Permalink
tools: fix type mismatch in test runner
Browse files Browse the repository at this point in the history
`output.diagnostic` is a list that is appended to on SmartOS when
retrying a test due to `ECONNREFUSED`. The test runner checks if
`output.diagnostic` is truthy and, if so, assigns its value to
`self.traceback`. However `self.traceback` is supposed to be a string,
and `_printDiagnostic()` in the `TapProgressIndicator` attempts to call
`splitlines()` on it, which fails if it is a list with:
AttributeError: 'list' object has no attribute 'splitlines'

PR-URL: #38289
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Christian Clauss <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
  • Loading branch information
richardlau authored and targos committed Jun 11, 2021
1 parent d8acec4 commit d0eed18
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,10 @@ def HasRun(self, output):

if output.diagnostic:
self.severity = 'ok'
self.traceback = output.diagnostic
if isinstance(output.diagnostic, list):
self.traceback = '\n'.join(output.diagnostic)
else:
self.traceback = output.diagnostic


duration = output.test.duration
Expand Down

0 comments on commit d0eed18

Please sign in to comment.