From f26903f57a62c89fce221e069df5535d65101ea4 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Mon, 16 Nov 2026 09:06:03 +0100 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_01WzxdWWfb63jncj9Lca2jeX --- screen_locker/tests/_gatelock_fixtures.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/screen_locker/tests/_gatelock_fixtures.py b/screen_locker/tests/_gatelock_fixtures.py index f30ab17..ff47445 100644 --- a/screen_locker/tests/_gatelock_fixtures.py +++ b/screen_locker/tests/_gatelock_fixtures.py @@ -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),