Files
Kurt VanDusenandClaude Opus 5.5 f7fb21ac34 fix(gateway): say where a capped watch notice's output still lives
The drain's retry cap drops a watch notice after its last refusal; the
warning now says the output stays available via process(action='log'),
as the gone-pin drop and the completion pre-flight already do.

Tests: assert the backoff doubles to its cap instead of only a lower
bound; move the transport-retry test's clock a minute per watcher tick
rather than per read, which also drove the orphan-sweep throttle; cover
a refused notice with no pinned session (requeued, never dropped).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 03:19:01 -07:00

25 lines
743 B
Python

"""One module's view of ``time`` with a test-driven ``monotonic``.
Patching ``time.monotonic`` itself also moves the running event loop's clock (its timers read the
same function); this swaps only the module's ``time`` binding, so the loop keeps real time."""
import time
class ModuleClock:
"""``time`` for one module, except that ``monotonic()`` returns ``now``."""
def __init__(self, now: float):
self.now = now
def monotonic(self) -> float:
return self.now
def __getattr__(self, name):
return getattr(time, name)
def install_module_clock(monkeypatch, module, *, now: float = 1000.0) -> ModuleClock:
clock = ModuleClock(now)
monkeypatch.setattr(module, "time", clock)
return clock