Skip to content

The agent that grows with you

test(gateway): automation peer polls for the producer commit instead of a fixed 70 s sleep

Tekniumef3f4704cd0b
diff --git a/tests/gateway/fixtures/automation_peer.py b/tests/gateway/fixtures/automation_peer.py
index a69d366ef80..9c504bde428 100644
--- a/tests/gateway/fixtures/automation_peer.py
+++ b/tests/gateway/fixtures/automation_peer.py
@@ -150,7 +150,11 @@ async def probe(root, base, mode):
await wait_for(lambda: any(r['request_id'] == 'human-follower' for r in rows()))
model.gate.touch()
# Real cadence: process polls every five seconds; heartbeat interval is one minute.
- await asyncio.sleep(8 if mode == 'terminal' else 70)
+ # Poll for the producer's commit instead of sleeping out the whole bound.
+ deadline = time.monotonic() + (8 if mode == 'terminal' else 70)
+ while (time.monotonic() < deadline
+ and not any(r['principal_id'].startswith('automation:') for r in rows())):
+ await asyncio.sleep(.1)
ledger = rows()
automatic = [r for r in ledger if r['principal_id'].startswith('automation:')]
assert automatic, {'failure': 'producer ACK bypassed canonical durable FIFO', 'ledger': ledger,