Skip to content

Commit 18e7462

Browse files
committed
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'
1 parent 13d0de5 commit 18e7462

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/test.py

Lines changed: 4 additions & 1 deletion
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)