Skip to content

Commit 14b8da0

Browse files
committed
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 <martin.vogel.tech@gmail.com>
1 parent 54c1864 commit 14b8da0

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎scripts/benchmark-index.sh‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ LANG="${2:?}"
99
REPO="${3:?}"
1010
RESULTS_DIR="${4:?}"
1111

12+
OUT="$RESULTS_DIR/$LANG"
13+
mkdir -p "$OUT"
14+
# A handoff names this run's index or none: the evaluation loop reuses the
15+
# results directory, and a stale one would point the graph session at a root
16+
# step 8 has already removed. It goes before any setup step that can fail, so
17+
# a run that never reaches the index cannot leave an earlier one behind.
18+
rm -f -- "$OUT/runtime-root.txt"
19+
1220
# The index must run against a daemon rendezvous and cache this run owns: only
1321
# CBM_RUNTIME_DIR moves the rendezvous, and without a private cache the
1422
# 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"
5967
# even though each comes from its own process.
6068
bench_now_ms() { python3 -c "import time; print(time.monotonic_ns() // 1000000)"; }
6169

62-
OUT="$RESULTS_DIR/$LANG"
63-
mkdir -p "$OUT"
64-
# A handoff names this run's index or none: the evaluation loop reuses the
65-
# results directory, and a stale one would point the graph session at a root
66-
# step 8 has already removed.
67-
rm -f -- "$OUT/runtime-root.txt"
68-
6970
echo "INDEX: $LANG ($REPO)"
7071

7172
# Count source files and LOC (exclude .git, vendor, node_modules, build dirs)

0 commit comments

Comments
 (0)