From 1356172642da0cc03515a5e0d96302578a382ba6 Mon Sep 17 00:00:00 2001 From: kimi Date: Mon, 23 Mar 2026 22:57:12 -0400 Subject: [PATCH] fix: stub cv2 in tests to prevent timeout under pytest-xdist Add 'cv2' to the list of stubbed modules in conftest.py to prevent OpenCV import from hanging under pytest-xdist parallel workers. The perception_cache.py module imports cv2 at the module level, which can cause deadlocks/hangs when running tests in parallel with pytest-xdist. By stubbing cv2 in conftest.py, tests get a MagicMock instead of the real cv2, avoiding the import hang. Fixes #1336 --- tests/conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/conftest.py b/tests/conftest.py index bf684f69..1ee41a5b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -33,6 +33,7 @@ for _mod in [ "sentence_transformers", "swarm", "swarm.event_log", + "cv2", # OpenCV import can hang under pytest-xdist parallel workers ]: sys.modules.setdefault(_mod, MagicMock()) -- 2.43.0