diff --git a/tests/test_dispatcher.py b/tests/test_dispatcher.py index 8ddc865..4ed66e9 100644 --- a/tests/test_dispatcher.py +++ b/tests/test_dispatcher.py @@ -184,10 +184,12 @@ class TestDispatch: class TestConcurrencyControl: def test_counter_busy_skips(self, dispatcher, task_pending): - """Agent 忙 → skip""" - mock_counter = MagicMock() - mock_counter.can_acquire = AsyncMock(return_value=False) - dispatcher.counter = mock_counter + """Agent 忙 → skip(v2.8 #07: AgentBusyError 从 spawn_full_agent 抛出)""" + mock_spawner = MagicMock() + mock_spawner.spawn_full_agent = AsyncMock( + side_effect=AgentBusyError("zhangfei-dev", reason="counter_blocked") + ) + dispatcher.spawner = mock_spawner result = asyncio.run(dispatcher.dispatch(task_pending)) assert result["status"] == "skipped"