From d9969db3cd33c776eb7a96286720797e85774512 Mon Sep 17 00:00:00 2001 From: Jer Miller Date: Thu, 16 Apr 2026 21:10:16 -0600 Subject: [PATCH] fix(tests): skip maint subprocesses in singleton-lock test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_supervisor_singleton_lock_acquired called mod.main() which, since ec004821, runs run_pending_tasks() before start_callosum_in_process. On a fresh tmp_path, every maint script is pending, so main() spawned 12 subprocesses (~1.5-2s under coverage) before reaching the stub that raises SystemExit(0). Under system load that overruns the 5s default pytest-timeout, producing the intermittent FAILED seen during full-suite runs. Monkeypatch run_pending_tasks to a no-op — the test is about flock acquisition, not migrations. Verified with 10 consecutive `make test` runs, all green. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/test_supervisor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_supervisor.py b/tests/test_supervisor.py index 666db6288..62a58dc78 100644 --- a/tests/test_supervisor.py +++ b/tests/test_supervisor.py @@ -597,6 +597,9 @@ def test_supervisor_singleton_lock_acquired(tmp_path, monkeypatch): def stop_after_lock(): raise SystemExit(0) + # Skip maint discovery/subprocess runs — unrelated to lock acquisition and + # slow enough on a fresh tmp_path to blow the 5s pytest-timeout under load. + monkeypatch.setattr(mod, "run_pending_tasks", lambda *a, **k: (0, 0)) monkeypatch.setattr(mod, "start_callosum_in_process", stop_after_lock) with pytest.raises(SystemExit) as exc: -- 2.51.2