From ec802525aef58a7226dabef5bbf6b1a838897cb5 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Thu, 26 Nov 2026 20:11:26 -0500 Subject: [PATCH] fix(steam): reject Steam Lite cycles whose guest recording failed --- tools/steam_lite_bench.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/steam_lite_bench.py b/tools/steam_lite_bench.py index 258c5ee553..0813354f9f 100644 --- a/tools/steam_lite_bench.py +++ b/tools/steam_lite_bench.py @@ -419,7 +419,7 @@ def cycle(dev: Device, app: str, profile: str, run_dir: Path, args) -> dict: [sys.executable, str(CTL)] + (["--serial", dev.serial] if dev.serial else []) + ["guest", "--timeout", str(total + 30), "--", LITE, "record", str(total), str(args.interval), REMOTE + "/samples.jsonl", "--mark", REMOTE + "/mark"] + cdp, - stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + stdout=open(run_dir / "recorder.json", "w"), stderr=subprocess.STDOUT) events = {"profile": profile, "app": app, "started": time.time()} try: time.sleep(args.idle) @@ -457,6 +457,14 @@ def cycle(dev: Device, app: str, profile: str, run_dir: Path, args) -> dict: recorder.wait(timeout=total + 120) text = dev.fetch(REMOTE + "/samples.jsonl") (run_dir / "samples.jsonl").write_text(text) + try: + reply = json.loads((run_dir / "recorder.json").read_text() or "{}") + except ValueError: + reply = {} + samples = [line for line in text.splitlines() if line.strip()] + if recorder.returncode != 0 or reply.get("exitCode") not in (0, None) or len(samples) < 2: + raise RuntimeError("the guest recorder failed (exit %s, %d samples); see %s" + % (reply.get("exitCode", recorder.returncode), len(samples), run_dir / "recorder.json")) events["finished"] = time.time() events["status_after"] = dev.status() (run_dir / "events.json").write_text(json.dumps(events, indent=1))