Skip to content
This repository was archived by the owner on May 31, 2026. It is now read-only.

Commit 0d8f1e0

Browse files
groksrcclaude
andcommitted
test: bump prefetch integration test budget to 30s with diagnostic
The 5s deadline was too tight for cold CI runners — prefetch's own actor.call times out at 3.0s per attempt, so 5s allowed only 1-2 retries before the index caught up. Recent runs (CI #25759526012) hit this and failed despite the production code being correct. 30s gives ~10 attempts and absorbs the worst observed cold-start delay (BM MCP server + onnxruntime initialization + first-index write). No production-path code changes — prefetch's own 3.0s timeout stays as-is (it's sized for the hot path; the integration test just needs a more generous outer budget). Assertion now reports attempts, failure_count, and circuit state so the next flake (if any) tells us whether BM didn't index in time vs prefetch's actor calls are timing out internally — different fixes in each case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e11a1c8 commit 0d8f1e0

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

tests/test_integration.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,27 @@ def test_prefetch_against_real_bm(provider, bm):
324324
"folder": "tests",
325325
})
326326

327-
# BM may need a beat to index the new note
328-
deadline = time.monotonic() + 5.0
327+
# BM may need time to index the new note. prefetch's own actor.call
328+
# times out at 3.0s per attempt; on a cold CI runner (especially with
329+
# onnxruntime startup), indexing latency plus a few retries can push
330+
# well past the previous 5s budget. 30s gives ~10 attempts and absorbs
331+
# the worst observed cold-start delays.
332+
deadline = time.monotonic() + 30.0
329333
out = ""
334+
attempts = 0
330335
while time.monotonic() < deadline:
336+
attempts += 1
331337
out = provider.prefetch(unique)
332338
if out:
333339
break
334340
time.sleep(0.25)
335341

336-
assert out, "prefetch returned nothing — BM may not have indexed the new note"
342+
assert out, (
343+
f"prefetch returned nothing after {attempts} attempt(s) over "
344+
f"{30.0}s; provider._failure_count={provider._failure_count}, "
345+
f"circuit_open={provider._is_circuit_open()}. "
346+
f"Either BM didn't index the note in time or prefetch's actor.call "
347+
f"is timing out internally."
348+
)
337349
assert "Basic Memory Recall" in out
338350
assert unique in out or "Prefetch Test" in out

0 commit comments

Comments
 (0)