auto-sync: 2026-06-01 22:47:26
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user