aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2015-07-12 01:26:17 +0200
committerGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2015-07-12 01:26:17 +0200
commitf716c0ca43bc6d9e90b109120dc827094b22b0a7 (patch)
treefa72f467b084a9829c3ec181871e1068a7adac28
parent594c2a4e2c302f43b0d9da51c067a65f1a2333fb (diff)
Filtering stdout for JUnit report in case of timeouts.
We're not properly filtering stdout in case we're timeouting. This generates invalid XML output.
-rwxr-xr-xtools/run_tests/jobset.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py
index b9af169739..46137f01f4 100755
--- a/tools/run_tests/jobset.py
+++ b/tools/run_tests/jobset.py
@@ -209,10 +209,11 @@ class Job(object):
elif self._state == _RUNNING and time.time() - self._start > 600:
self._tempfile.seek(0)
stdout = self._tempfile.read()
+ filtered_stdout = filter(lambda x: x in string.printable, stdout.decode(errors='ignore'))
message('TIMEOUT', self._spec.shortname, stdout, do_newline=True)
self.kill()
if self._xml_test is not None:
- ET.SubElement(self._xml_test, 'system-out').text = stdout
+ ET.SubElement(self._xml_test, 'system-out').text = filtered_stdout
ET.SubElement(self._xml_test, 'error', message='Timeout')
return self._state