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