From 53b4a133e2e4468416858424dc97339676ee805d Mon Sep 17 00:00:00 2001 From: Hanashi Date: Thu, 6 Aug 2026 03:48:37 -0400 Subject: [PATCH] bench: survive server loss during polling (mark run failed, keep suite alive) Co-Authored-By: Claude Fable 5 --- bench/minimax_bench.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bench/minimax_bench.py b/bench/minimax_bench.py index e6436e4..b465c7f 100644 --- a/bench/minimax_bench.py +++ b/bench/minimax_bench.py @@ -196,9 +196,21 @@ def run_one(api, cfg, poll=2.0, timeout=3600): prompt_id = resp["prompt_id"] exec_start = exec_end = None status_str = None + poll_failures = 0 while time.time() - t0 < timeout: time.sleep(poll) - h = api.history(prompt_id) + try: + h = api.history(prompt_id) + poll_failures = 0 + except Exception as e: + poll_failures += 1 + if poll_failures >= 10: + stop.set() + return {**cfg, "ok": False, "status": "server_lost", + "wall_s": round(time.time() - t0, 1), "exec_s": None, + "peak_vram_gb": round(peak["vram"] / 1e9, 1) if peak["vram"] else None, + "outputs": [], "error": f"server unreachable while polling: {e}"} + continue if prompt_id in h: entry = h[prompt_id] status_str = entry.get("status", {}).get("status_str")