From fc202968475fd339be0aa8c079a8802d222511ca Mon Sep 17 00:00:00 2001 From: muse Date: Wed, 4 Nov 2026 17:30:07 +0100 Subject: [PATCH] CI: sleep BEFORE write_control in playwright race test (sleep after write does not change file mtime, so previous fix could not work; runner mtime lags wall clock ~1ms) --- cloud/tests/test_playwright_bridge.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cloud/tests/test_playwright_bridge.py b/cloud/tests/test_playwright_bridge.py index aad25c5..499b255 100644 --- a/cloud/tests/test_playwright_bridge.py +++ b/cloud/tests/test_playwright_bridge.py @@ -170,13 +170,15 @@ class BridgeTestCase(unittest.TestCase): state, _ = read_state(self.tmp.name) self.assertEqual(effective_holder(self.tmp.name, state), "agent") - write_control(self.tmp.name, "user") # Gitea runner filesystem mtime lags wall clock by ~1ms # (measured 0.2-1.0ms in runner container), so a # back-to-back write can appear older than updated_at. - # Wait out the lag; the test's intent is "newer control - # wins", not "same-millisecond writes are ordered". + # Sleep BEFORE writing, so the control file is genuinely + # newer (sleeping after the write does not change its + # mtime). The test's intent is "newer control wins", + # not "same-millisecond writes are ordered". time.sleep(0.05) + write_control(self.tmp.name, "user") self.assertEqual(effective_holder(self.tmp.name, state), "user") # Once the MCP polls, the state file catches up and both