From d0eed18c873f420d3d3c3fbb8f2a9e19d062616d Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Sun, 18 Apr 2021 19:21:22 -0400 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/38289 Reviewed-By: Rich Trott Reviewed-By: Christian Clauss Reviewed-By: Luigi Pinca Reviewed-By: Benjamin Gruenbaum --- tools/test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/test.py b/tools/test.py index 2884bf44bd1dbe..d2c09169a46a41 100755 --- a/tools/test.py +++ b/tools/test.py @@ -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