From 346d05faf1f6819a8a75a89fb01dcd41bc14e583 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 9 Nov 2026 09:06:49 +0000 Subject: [PATCH] test(test-e2e-playwright): make run_parallel rendezvous waits mutual MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The concurrency tests proved overlap with a one-sided wait: only one job waited for its partner's start line. Under load (core `make test` runs about 80 workers) the partner could start and finish before the waiting job's interpreter wrote its own start, so `_peak()` saw 1 and test_onion_jobs_share_tor_with_each_other failed. - a and b, onion-a and onion-b now wait for each other, so both intervals contain both start stamps and overlap whenever the scheduler runs them together; a serial scheduler still times out and fails. - onion-b's timeout is checked like onion-a's. - every onion job in the tor-cap test waits for clear, so the assertion holds whichever onion job takes the single tor slot first. Evidence: the three tests 20x each across 8 xdist workers, 60 passed; the whole file, 41 passed. 🎯 fix 92 % · 💥 break 1 % · 💸 cost – · ⏱️ time – · 🛡️ security 100 % · 🏆 score 91 Co-Authored-By: Claude Opus 5.5 --- .../roles/test-e2e-playwright/files/test_run_parallel.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/unit/python/roles/test-e2e-playwright/files/test_run_parallel.py b/tests/unit/python/roles/test-e2e-playwright/files/test_run_parallel.py index 596da9645c..45110abe0b 100644 --- a/tests/unit/python/roles/test-e2e-playwright/files/test_run_parallel.py +++ b/tests/unit/python/roles/test-e2e-playwright/files/test_run_parallel.py @@ -385,7 +385,7 @@ class TestRun(unittest.TestCase): rc=1 if name == "b" else 0, after=["head"], timeout=10, - until="b" if name == "a" else None, + until={"a": "b", "b": "a"}.get(name), ) (self.jobs / rp.SEALED).touch() self.assertEqual(self._run(2), 0) @@ -534,10 +534,11 @@ class TestRun(unittest.TestCase): def test_onion_jobs_share_tor_with_each_other(self): self._job(0, "onion-a", 0.1, tor=True, timeout=10, until="onion-b") - self._job(1, "onion-b", 0.1, tor=True) + self._job(1, "onion-b", 0.1, tor=True, timeout=10, until="onion-a") (self.jobs / rp.SEALED).touch() self.assertEqual(self._run(2), 0) self.assertFalse(self._result("onion-a")["timed_out"]) + self.assertFalse(self._result("onion-b")["timed_out"]) self.assertEqual(self._peak(), 2) def test_onion_jobs_stay_within_the_tor_cap(self): @@ -548,7 +549,7 @@ class TestRun(unittest.TestCase): 0.4, tor=True, timeout=10, - until="clear" if name == "onion-a" else None, + until="clear", ) self._job(3, "clear", 0.4) (self.jobs / rp.SEALED).touch()