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 <martin.vogel.tech@gmail.com>
This commit is contained in:
Martin Vogel
2026-11-02 00:06:52 +01:00
parent 14b8da00c3
commit b9851700a4
2 changed files with 16 additions and 2 deletions
+8 -1
View File
@@ -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
+8 -1
View File
@@ -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