auto-sync: 2026-06-01 22:47:26

This commit is contained in:
cfdaily
2026-06-01 22:47:26 +08:00
parent 3771ae9b95
commit 158ec8a219
+6 -4
View File
@@ -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 忙 → skipv2.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"