diff --git a/tests/test_dispatcher.py b/tests/test_dispatcher.py index f6434da..8ddc865 100644 --- a/tests/test_dispatcher.py +++ b/tests/test_dispatcher.py @@ -194,19 +194,13 @@ class TestConcurrencyControl: assert "busy" in result["reason"].lower() def test_counter_releases_on_error(self, dispatcher, task_pending): - """spawn 失败后释放 counter""" + """spawn 失败后释放 counter(v2.8 #07: counter.release 由 spawn_full_agent 内部保证)""" mock_spawner = MagicMock() mock_spawner.spawn_full_agent = AsyncMock(side_effect=RuntimeError("fail")) - mock_counter = MagicMock() - mock_counter.can_acquire = AsyncMock(return_value=True) - mock_counter.acquire = AsyncMock() - mock_counter.release = MagicMock() dispatcher.spawner = mock_spawner - dispatcher.counter = mock_counter result = asyncio.run(dispatcher.dispatch(task_pending)) assert result["status"] == "error" - mock_counter.release.assert_called_once_with("zhangfei-dev") def test_local_not_blocked_by_counter(self, dispatcher, task_pending): """本地执行不受 counter 限制"""