diff --git a/tests/test_run_wine_tests.py b/tests/test_run_wine_tests.py index 7ba55d2f8e..8c1f214f5f 100644 --- a/tests/test_run_wine_tests.py +++ b/tests/test_run_wine_tests.py @@ -601,7 +601,8 @@ def test_no_wineserver_is_one_line_and_the_run_goes_on(self): self.assertIn("[PASS] ok", out) def timed(self, name, *, props=None, code=0, sleep=0.3): - """A test that logs when it starts and ends, to see which tests overlapped.""" + """A test that logs when it starts and ends, to see which tests overlapped. Each has a log of its own: on + Windows, lines that several processes append to one file at the same moment overwrite each other.""" (self.artifact / f"{name}.py").write_text( "import os, sys, time\n" "log = os.environ['TIMING_LOG']\n" @@ -610,14 +611,15 @@ def timed(self, name, *, props=None, code=0, sleep=0.3): f"open(log, 'a').write('{name} end %r\\n' % time.monotonic())\n" f"sys.exit({code})\n", encoding="utf-8", newline="\n") props = dict(props or {}) - props["ENVIRONMENT"] = ["TIMING_LOG=" + str(self.root / "timing.log")] + props["ENVIRONMENT"] = ["TIMING_LOG=" + str(self.root / f"timing.{name}.log")] return ctest_entry(name, self.command(f"{name}.py"), props) def intervals(self): spans: dict[str, list[float]] = {} - for line in (self.root / "timing.log").read_text(encoding="utf-8").splitlines(): - name, _, when = line.split() - spans.setdefault(name, []).append(float(when)) + for log in sorted(self.root.glob("timing.*.log")): + for line in log.read_text(encoding="utf-8").splitlines(): + name, _, when = line.split() + spans.setdefault(name, []).append(float(when)) return spans @staticmethod