Skip to content
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
tools: fix type mismatch in test runner
`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 committed Apr 21, 2021
commit e703ceb8b48befa2097bb11943293706835834bc
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