Files
amethyst/quic/interop/inspect-multiplexing.sh
T
Claude 226fa14882 chore(quic-interop): inspect — point at the actual runner paths
Runner persists:
  <case>/output.txt              — runner stdout/stderr (+ client logs)
  <case>/client/qlog/*.sqlog     — qlog under client/qlog/, not client/
  <case>/server/stderr.log       — server stderr (CONNECTION_CLOSE reason)

Plus targeted grep for the events we actually need to localize a
multiplexing failure:
  - last 5 packet_received / packet_sent (where did the flow stall)
  - connection_closed (peer error code + reason)
  - packet_dropped (sign of decrypt fails / unknown CID / etc.)
2026-05-07 03:09:19 +00:00

77 lines
2.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Pull the post-mortem diagnostics for the most recent multiplexing run.
# Runs from anywhere; resolves logs relative to the runner clone path
# you've been using (../quic-interop-runner from this repo).
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
RUNNER_LOGS="${REPO_ROOT}/../quic-interop-runner/logs"
if [[ ! -d "$RUNNER_LOGS" ]]; then
echo "no runner logs at $RUNNER_LOGS" >&2
exit 1
fi
# Most recent run dir.
RUN_DIR="$(ls -1dt "$RUNNER_LOGS"/run-* 2>/dev/null | head -n 1 || true)"
if [[ -z "$RUN_DIR" ]]; then
echo "no run-* dirs under $RUNNER_LOGS" >&2
exit 1
fi
echo "==> run dir: $RUN_DIR"
# Layout: <run>/<server>_<client>/<testcase>/{client,server,sim}/
CASE_DIR="$(ls -1d "$RUN_DIR"/*amethyst*/multiplexing 2>/dev/null | head -n 1 || true)"
if [[ -z "$CASE_DIR" ]]; then
echo "no <pair>/multiplexing dir; tree under run:" >&2
find "$RUN_DIR" -maxdepth 3 -type d >&2
exit 1
fi
echo "==> case dir: $CASE_DIR"
echo
echo "=============== file tree under case dir ==============="
find "$CASE_DIR" -maxdepth 4 -type f -printf '%s\t%p\n' 2>/dev/null \
|| find "$CASE_DIR" -maxdepth 4 -type f -exec ls -l {} + 2>/dev/null
echo
echo "=============== output.txt (runner stdout — last 200 lines) ==============="
tail -n 200 "$CASE_DIR/output.txt" 2>/dev/null \
|| echo "(no output.txt)"
echo
echo "=============== server stderr (last 100 lines) ==============="
tail -n 100 "$CASE_DIR/server/stderr.log" 2>/dev/null \
|| echo "(no server/stderr.log)"
# Find the qlog. The runner mounts QLOGDIR=/logs/qlog so we land at
# client/qlog/<odcid>.sqlog inside the case dir.
QLOG="$(ls -1 "$CASE_DIR"/client/qlog/*.sqlog \
"$CASE_DIR"/client/qlog/*.qlog \
"$CASE_DIR"/client/*.sqlog \
"$CASE_DIR"/client/*.qlog 2>/dev/null | head -n 1 || true)"
if [[ -n "$QLOG" ]]; then
echo
echo "=============== qlog event-type histogram ==============="
echo "(file: $QLOG, $(wc -l <"$QLOG" | tr -d ' ') lines)"
grep -oE '"name":"[^"]+"' "$QLOG" | sort | uniq -c | sort -rn | head -n 20
echo
echo "=============== last 5 packet_received events ==============="
grep '"name":"transport:packet_received"' "$QLOG" | tail -n 5
echo
echo "=============== last 5 packet_sent events ==============="
grep '"name":"transport:packet_sent"' "$QLOG" | tail -n 5
echo
echo "=============== connection_closed events ==============="
grep '"name":"transport:connection_closed"' "$QLOG" || echo "(none — connection didn't formally close)"
echo
echo "=============== packet_dropped events (last 10) ==============="
grep '"name":"transport:packet_dropped"' "$QLOG" | tail -n 10 \
|| echo "(none)"
fi