From 14b8da00c3a7ee559c5b07ec4e8e220e171c79e7 Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Mon, 2 Nov 2026 00:06:52 +0100 Subject: [PATCH] fix(test): drop a stale benchmark handoff before setup can fail benchmark-index.sh removed the runtime-root.txt of an earlier run only after the repository path, the private runtime and the temp directory had been set up. A run that failed in one of those steps exited non-zero but left the previous handoff in the reused results directory, and section 7 of the evaluation plan sources that file unconditionally, so the graph session would be pointed at a root that step 8 has already removed. The results directory is now created and the stale handoff removed right after argument parsing, before any setup step that can fail. Signed-off-by: Martin Vogel --- scripts/benchmark-index.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/benchmark-index.sh b/scripts/benchmark-index.sh index 207944a85..5ab4353bb 100755 --- a/scripts/benchmark-index.sh +++ b/scripts/benchmark-index.sh @@ -9,6 +9,14 @@ LANG="${2:?}" REPO="${3:?}" RESULTS_DIR="${4:?}" +OUT="$RESULTS_DIR/$LANG" +mkdir -p "$OUT" +# A handoff names this run's index or none: the evaluation loop reuses the +# results directory, and a stale one would point the graph session at a root +# step 8 has already removed. It goes before any setup step that can fail, so +# a run that never reaches the index cannot leave an earlier one behind. +rm -f -- "$OUT/runtime-root.txt" + # The index must run against a daemon rendezvous and cache this run owns: only # CBM_RUNTIME_DIR moves the rendezvous, and without a private cache the # benchmark repository was indexed into the operator's live store (#1696). @@ -59,13 +67,6 @@ REPO_JSON=$(python3 -c 'import json,sys; print(json.dumps(sys.argv[1]))' "$REPO" # even though each comes from its own process. bench_now_ms() { python3 -c "import time; print(time.monotonic_ns() // 1000000)"; } -OUT="$RESULTS_DIR/$LANG" -mkdir -p "$OUT" -# A handoff names this run's index or none: the evaluation loop reuses the -# results directory, and a stale one would point the graph session at a root -# step 8 has already removed. -rm -f -- "$OUT/runtime-root.txt" - echo "INDEX: $LANG ($REPO)" # Count source files and LOC (exclude .git, vendor, node_modules, build dirs)