Skip to content

Commit d3bd4b4

Browse files
richardlautargos
authored andcommitted
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]>
1 parent 05f41cd commit d3bd4b4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/test.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,10 @@ def HasRun(self, output):
375375

376376
if output.diagnostic:
377377
self.severity = 'ok'
378-
self.traceback = output.diagnostic
378+
if isinstance(output.diagnostic, list):
379+
self.traceback = '\n'.join(output.diagnostic)
380+
else:
381+
self.traceback = output.diagnostic
379382

380383

381384
duration = output.test.duration

0 commit comments

Comments
 (0)