diff options
author | Richard Lau <rlau@redhat.com> | 2021-04-19 02:21:22 +0300 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2021-04-29 14:45:26 +0300 |
commit | d3bd4b4771e9f9a72cabac0606161c002a049883 (patch) | |
tree | f6e65a0ad83d6cb8ae45047fdb08fe2fbe1e5333 /tools | |
parent | 05f41cdbccac9bc6b6e2bd9ff9c6aec5a024a92b (diff) |
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 <rtrott@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/test.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/test.py b/tools/test.py index cdeb40d59cd..c3a7ff07e23 100755 --- a/tools/test.py +++ b/tools/test.py @@ -375,7 +375,10 @@ class TapProgressIndicator(SimpleProgressIndicator): 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 |