From 71ce8dc27652f58a44e11b7ad5d06dc1a2db28ba Mon Sep 17 00:00:00 2001 From: MrScripty Date: Fri, 6 Nov 2026 12:12:02 -0700 Subject: [PATCH] test(rpc): settle the startup probe before checking cached search calls Startup spawns one non-blocking connectivity probe against api.github.com and huggingface.co. The cached-search qualification took its "before" count of proxied upstream calls as soon as the RPC port was printed, so on a slow runner the probe's two CONNECTs landed afterwards and were blamed on the cached browse (main run 42272350224). Wait until get_network_status reports offline, which happens once the probe has been refused, before taking the baseline. The check that a cached browse/filter makes no upstream call is unchanged. Co-Authored-By: Claude Opus 5.5 --- scripts/tests/qualify-hf-cached-search-ui.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/tests/qualify-hf-cached-search-ui.py b/scripts/tests/qualify-hf-cached-search-ui.py index 4425b34b..0bcfeb80 100644 --- a/scripts/tests/qualify-hf-cached-search-ui.py +++ b/scripts/tests/qualify-hf-cached-search-ui.py @@ -18,6 +18,7 @@ import subprocess import tempfile import threading +import time import urllib.request ROOT = Path(__file__).resolve().parents[2] @@ -169,6 +170,13 @@ def capture(): try: port = ready.get(timeout=25) base = f"http://127.0.0.1:{port}" + # Startup runs one connectivity probe in the background. Every probe is + # refused by the proxy, so the library reports offline once it ends; + # only calls after that point can be attributed to the cached search. + probe_deadline = time.monotonic() + 20 + while not rpc(base, "get_network_status", {})["is_offline"]: + check(time.monotonic() < probe_deadline, "startup connectivity probe did not settle") + time.sleep(0.1) seed_ordinary_search(root) cached_calls_before = len(proxy.calls) results["startup_upstream_call_count"] = cached_calls_before