From b9851700a431e5589f050970f275dde140ba7f3c Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Mon, 2 Nov 2026 00:06:52 +0100 Subject: [PATCH] fix(test): surface why a benchmark daemon did not start Both harnesses discarded the output of `daemon start`, so a refused start was reported only as "private daemon did not start", the symptom without its cause. The output now goes to a run-private file next to the index stderr, the shape both scripts already use for the index call, and is printed under "--- daemon start output ---" when the start fails. Signed-off-by: Martin Vogel --- scripts/benchmark-index.sh | 9 ++++++++- scripts/benchmark-search-graph.sh | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/benchmark-index.sh b/scripts/benchmark-index.sh index 5ab4353bb..a8db36828 100755 --- a/scripts/benchmark-index.sh +++ b/scripts/benchmark-index.sh @@ -52,6 +52,7 @@ trap bench_finish EXIT # it the failure below could name only its symptom. BENCH_TMP=$(mktemp -d) INDEX_ERR="$BENCH_TMP/index-stderr.log" +DAEMON_START_LOG="$BENCH_TMP/daemon-start.log" # Resolve symlinks REPO=$(cd "$REPO" && pwd -P) @@ -90,8 +91,14 @@ echo "$LOC" > "$OUT/loc.txt" # total-time.txt is their sum — the figure comparable with earlier runs, which # paid activation inside the index timing whenever no daemon was already warm. SETUP_START_MS=$(bench_now_ms) -if ! "$BINARY" daemon start >/dev/null 2>&1; then +# Its output is kept for the failure path: the product names why a daemon did +# not start, and that is the part an operator needs. +if ! "$BINARY" daemon start >"$DAEMON_START_LOG" 2>&1; then echo " $LANG: private daemon did not start" >&2 + if [ -s "$DAEMON_START_LOG" ]; then + echo "--- daemon start output ---" >&2 + cat "$DAEMON_START_LOG" >&2 + fi exit 1 fi diff --git a/scripts/benchmark-search-graph.sh b/scripts/benchmark-search-graph.sh index 6296d31fb..dad4f6ec4 100755 --- a/scripts/benchmark-search-graph.sh +++ b/scripts/benchmark-search-graph.sh @@ -26,9 +26,16 @@ BENCH_TMP="" trap 'cbm_test_runtime_cleanup "$BINARY"; [ -z "$BENCH_TMP" ] || rm -rf -- "$BENCH_TMP"' EXIT BENCH_TMP=$(mktemp -d) INDEX_ERR="$BENCH_TMP/index-stderr.log" +DAEMON_START_LOG="$BENCH_TMP/daemon-start.log" -if ! "$BINARY" daemon start >/dev/null 2>&1; then +# Its output is kept for the failure path: the product names why a daemon did +# not start, and that is the part an operator needs. +if ! "$BINARY" daemon start >"$DAEMON_START_LOG" 2>&1; then echo "private daemon did not start" >&2 + if [ -s "$DAEMON_START_LOG" ]; then + echo "--- daemon start output ---" >&2 + cat "$DAEMON_START_LOG" >&2 + fi exit 1 fi # One pre-escaped spelling of the path, the way the soak harness builds its