The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(gateway): let the watch-drain transport retry wait out its backoff
Kurt VanDusen7c16f965080f
diff --git a/tests/gateway/test_completion_delivery.py b/tests/gateway/test_completion_delivery.pyindex 7c651a61c70..514dbfcd298 100644--- a/tests/gateway/test_completion_delivery.py+++ b/tests/gateway/test_completion_delivery.py@@ -7,14 +7,17 @@ state (when available) is acknowledged through its authoritative SQLite API."""import asyncio+import itertoolsimport jsonimport queue+import timefrom collections import OrderedDictfrom types import SimpleNamespacefrom unittest.mock import AsyncMock, MagicMock, patchimport pytest+from gateway import run_notificationsfrom gateway.config import Platformfrom gateway.run import GatewayRunnerfrom tools.process_registry import ProcessRegistry, ProcessSession@@ -986,6 +989,9 @@ def test_watch_drain_retries_transport_failure(monkeypatch, isolated_registry):evt = dict(_completion_event(started_at=1), type="watch_match", pattern="READY", output="READY")isolated_registry.completion_queue.put(evt)_stop_after_sleeps(monkeypatch, runner, count=3)+ # The refused event backs off (#140899); each read is a minute later, so the retry is due.+ real, minutes = time.monotonic, itertools.count()+ monkeypatch.setattr(run_notifications.time, "monotonic", lambda: real() + 60 * next(minutes))asyncio.run(runner._async_delegation_watcher(interval=0))assert adapter.handle_message.await_count == 2assert isolated_registry.completion_queue.empty()