From 158ec8a21947fb9df43c1ba3e9b8a0ac1de93327 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Mon, 1 Jun 2026 22:47:26 +0800 Subject: [PATCH] auto-sync: 2026-06-01 22:47:26 --- tests/test_dispatcher.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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"