Skip to content

Commit c1ee2b2

Browse files
authored
Fix parallel_testsuite in the case that tests are retried (#25748)
Fixes: #25745
1 parent 389b097 commit c1ee2b2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/parallel_testsuite.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ def printResult(res):
115115
# working directory is not within it.
116116
os.chdir(olddir)
117117
common.force_delete_dir(temp_dir)
118+
119+
# Since we are returning this result to the main thread we need to make sure
120+
# that it is serializable/picklable. To do this, we delete any non-picklable
121+
# fields from the instance.
122+
del result._original_stdout
123+
del result._original_stderr
124+
118125
return result
119126

120127

@@ -333,11 +340,6 @@ def stopTest(self, test):
333340
# TODO(sbc): figure out a way to display this duration information again when
334341
# these results get passed back to the TextTestRunner/TextTestResult.
335342
self.buffered_result.duration = self.test_duration
336-
# Once we are done running the test and any stdout/stderr buffering has
337-
# being taking care or, we delete these fields which the parent class uses.
338-
# This is because they are not picklable (serializable).
339-
del self._original_stdout
340-
del self._original_stderr
341343

342344
def addSuccess(self, test):
343345
super().addSuccess(test)

0 commit comments

Comments
 (0)