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
This commit is contained in:
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user