Zero gatelock's startup grace in tests

wait_for_turn sleeps its 1.5 s startup grace for real, so every test
that builds a locker paid it. The suite took ~135 s under the CPU
cap and the ci-pytest gate step could not finish inside the 60 s
action cap. With the grace zeroed in the hermetic gatelock fixture
all 2142 tests run in 13 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWWfb63jncj9Lca2jeX
This commit is contained in:
Krzysztof Rudnicki 2026-11-16 09:06:03 +01:00
parent 9eac2ce3d6
commit f26903f57a

View File

@ -54,8 +54,13 @@ def _hermetic_gatelock(
The runtime dir is redirected as well, so a test cannot reach the real
``$XDG_RUNTIME_DIR`` and stand a *production* locker down through the
arbiter.
The queue's startup grace is zeroed too: ``wait_for_turn`` sleeps it for
real before its first look, which put 1.5 s on every test that builds a
locker and the suite far past the 60 s action cap.
"""
monkeypatch.setenv("GATELOCK_RUNTIME_DIR", str(tmp_path / "gatelock-runtime"))
monkeypatch.setattr("gatelock._queue.STARTUP_GRACE_SECONDS", 0.0)
with (
patch("gatelock._surfaces.tk.Toplevel", side_effect=_make_toplevel),
patch("gatelock._outputs.RandrBackend.create", return_value=None),