From db6e7d7d11e9dd2bcbff5d8d546d8ba699c0af05 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 7 May 2026 13:51:23 +0000 Subject: [PATCH] =?UTF-8?q?fix(quic-interop):=20inspect=20=E2=80=94=20'||?= =?UTF-8?q?=20true'=20for=20greps=20that=20may=20return=20zero=20matches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit set -euo pipefail kills the script on no-match grep. The run-09:45:21 output.txt has [writer.app] lines but no [batch] / [interop] (those were added in a later commit). The empty subset grep aborted the script silently after printing the section header. --- quic/interop/inspect-multiplexing.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/quic/interop/inspect-multiplexing.sh b/quic/interop/inspect-multiplexing.sh index 894f24b2c0..50c27ecbf1 100755 --- a/quic/interop/inspect-multiplexing.sh +++ b/quic/interop/inspect-multiplexing.sh @@ -41,15 +41,19 @@ echo "=============== writer-side debug traces (DEBUG=1 build only) ============ WRITER_LINES=$(grep -cE '\[(writer|batch|interop)' "$CASE_DIR/output.txt" 2>/dev/null) || WRITER_LINES=0 if [[ "$WRITER_LINES" -gt 0 ]]; then echo "($WRITER_LINES diagnostic lines; [batch] / [interop] entries first then first 30 [writer.app]:)" - grep -E '\[(batch|interop)' "$CASE_DIR/output.txt" | head -n 20 + # Use `|| true` because grep returns 1 on no matches and the + # script runs under `set -euo pipefail` — otherwise an empty + # [batch]/[interop] subset (run from a build without those logs) + # would abort the whole script. + grep -E '\[(batch|interop)' "$CASE_DIR/output.txt" | head -n 20 || true echo "..." - grep '\[writer' "$CASE_DIR/output.txt" | head -n 30 + grep '\[writer' "$CASE_DIR/output.txt" | head -n 30 || true echo echo "stream_frames histogram (writer-reported):" - grep -oE 'stream_frames=[0-9]+' "$CASE_DIR/output.txt" | sort | uniq -c | sort -rn + grep -oE 'stream_frames=[0-9]+' "$CASE_DIR/output.txt" | sort | uniq -c | sort -rn || true echo echo "active histogram (active stream count at drain time):" - grep -oE 'active=[0-9]+' "$CASE_DIR/output.txt" | sort | uniq -c | sort -rn + grep -oE 'active=[0-9]+' "$CASE_DIR/output.txt" | sort | uniq -c | sort -rn || true else echo "(no diagnostic lines yet — to enable, REBUILD the image with DEBUG=1:" echo " DEBUG=1 ./quic/interop/run-matrix.sh -s aioquic -t multiplexing"