Skip to content

Commit f84083b

Browse files
authored
Fix regrtest rerun: reset worker_bug (#162293)
When a test fails with "worker bug" and tests are rerun in verbose mode, reset worker_bug so that tests are marked as success if the failed test doesn't fail again when rerun in verbose mode. TestResult.write_json_into(file) now calls also file.flush().
1 parent 6957e70 commit f84083b

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

‎Lib/test/libregrtest/result.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ def get_rerun_match_tests(self) -> FilterTuple | None:
226226

227227
def write_json_into(self, file) -> None:
228228
json.dump(self, file, cls=_EncodeTestResult)
229+
file.flush()
229230

230231
@staticmethod
231232
def from_json(worker_json: StrJSON) -> 'TestResult':

‎Lib/test/libregrtest/results.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def prepare_rerun(self, *, clear: bool = True) -> tuple[TestTuple, FilterDict]:
168168
self.bad.clear()
169169
self.env_changed.clear()
170170
self.rerun_results.clear()
171+
self.worker_bug = False
171172

172173
return (tuple(tests), match_tests_dict)
173174

0 commit comments

Comments
 (0)