You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_skip_path_does_not_delete_holders_lock_file reddened main on macos-3.11 — its assertion cannot tell "P2 deleted the lock" from "P1 finished and released it" #312
main is red at 5679609 (#311, a docs-only merge — it cannot have caused this). One leg of twelve:
pytest (macos-latest, 3.11) failure
> assert lock_dir.is_dir() and lock_file.exists(), (
E AssertionError: P2's skip-path cleanup deleted the lock entirely — P1 is still running and now unprotected
E assert (False)
tests/test_save_session_lock_ownership.py:158: AssertionError
============ 1 failed, 1509 passed, 5 skipped in 453.63s (0:07:33) =============
The other eleven legs passed, including windows-latest, 3.11 and macos-latest, 3.10/3.12.
Why the message is not evidence for what it claims
The test builds a three-process race:
P1 runs save-session.sh with STUB_EXTRACT_SLEEP=3.0, so it holds save.lock for ~3 seconds.
P2 runs the same script, must hit the skip path, and exit.
Line 158 then asserts the lock still exists, on the stated grounds that P1 is still running.
Nothing in the test ever establishes that premise. There is no p1.poll() anywhere in tests/ (grep p1.poll tests/ → 0 results). So when P1's 3-second window closes before P2 finishes spawning bash, writing its env fixture and running the skip path, P1 releases the lock correctly, the file disappears correctly, and the assertion fires with a message accusing P2 of a teardown it never performed.
That run took 453s of wall clock for the suite. A 3.0s budget for "spawn a bash subprocess and let it reach a skip branch" is not a safe margin on a loaded macOS runner, and this is the second time a lock-ownership concurrency test has produced a single-leg red that cleared on a re-run.
This is the three-state defect class landing inside our own test suite: an absence produced by timing, rendered as an absence caused by the code under test. A test that cannot distinguish its failure mode from correct behaviour is not pinning the invariant it names — and the honest failure here is not "this is flaky", it is "this run was inconclusive".
What a fix has to do
Assert P1's liveness (p1.poll() is None) before line 158, so the run either tests the invariant or declares itself inconclusive rather than blaming P2.
Not simply raise extract_sleep and call it fixed — a larger number moves the flake, it does not remove the ambiguity. A liveness gate makes the timing budget's failure mode loud.
Same treatment for the P3 half below line 168, which rests on the identical unstated premise.
Not a product bug, on current evidence
save-session.sh only unlinks save.lock when it owns it (b61acfc, #168), acquisition is mkdir-based (#182/#185), and eleven legs agree. Nothing here says user data was at risk. The defect is that the test cannot prove that — in either direction.
Activity
test(#312): make the lock-ownership race prove its own premise (#313)