Skip to content

Commit b985170

Browse files
committed
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>
1 parent 14b8da0 commit b985170

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎scripts/benchmark-index.sh‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ trap bench_finish EXIT
5252
# it the failure below could name only its symptom.
5353
BENCH_TMP=$(mktemp -d)
5454
INDEX_ERR="$BENCH_TMP/index-stderr.log"
55+
DAEMON_START_LOG="$BENCH_TMP/daemon-start.log"
5556

5657
# Resolve symlinks
5758
REPO=$(cd "$REPO" && pwd -P)
@@ -90,8 +91,14 @@ echo "$LOC" > "$OUT/loc.txt"
9091
# total-time.txt is their sum — the figure comparable with earlier runs, which
9192
# paid activation inside the index timing whenever no daemon was already warm.
9293
SETUP_START_MS=$(bench_now_ms)
93-
if ! "$BINARY" daemon start >/dev/null 2>&1; then
94+
# Its output is kept for the failure path: the product names why a daemon did
95+
# not start, and that is the part an operator needs.
96+
if ! "$BINARY" daemon start >"$DAEMON_START_LOG" 2>&1; then
9497
echo " $LANG: private daemon did not start" >&2
98+
if [ -s "$DAEMON_START_LOG" ]; then
99+
echo "--- daemon start output ---" >&2
100+
cat "$DAEMON_START_LOG" >&2
101+
fi
95102
exit 1
96103
fi
97104

‎scripts/benchmark-search-graph.sh‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,16 @@ BENCH_TMP=""
2626
trap 'cbm_test_runtime_cleanup "$BINARY"; [ -z "$BENCH_TMP" ] || rm -rf -- "$BENCH_TMP"' EXIT
2727
BENCH_TMP=$(mktemp -d)
2828
INDEX_ERR="$BENCH_TMP/index-stderr.log"
29+
DAEMON_START_LOG="$BENCH_TMP/daemon-start.log"
2930

30-
if ! "$BINARY" daemon start >/dev/null 2>&1; then
31+
# Its output is kept for the failure path: the product names why a daemon did
32+
# not start, and that is the part an operator needs.
33+
if ! "$BINARY" daemon start >"$DAEMON_START_LOG" 2>&1; then
3134
echo "private daemon did not start" >&2
35+
if [ -s "$DAEMON_START_LOG" ]; then
36+
echo "--- daemon start output ---" >&2
37+
cat "$DAEMON_START_LOG" >&2
38+
fi
3239
exit 1
3340
fi
3441
# One pre-escaped spelling of the path, the way the soak harness builds its

0 commit comments

Comments
 (0)