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)
ci / test (push) Failing after 16m8s
ci / test (push) Failing after 16m8s
This commit is contained in:
1 parent
c1cb3f3d82
commit
fc20296847
1 file changed
+5
-3
@@ -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
|
||||
|
||||
Reference in new issue
Block a user