Skip to content

Commit 0ca6e7d

Browse files
authored
Break-glass merge PR DeusData#2638
2 parents 24d0251 + d772951 commit 0ca6e7d

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

‎scripts/soak-test.sh‎

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ CBM_SOAK_MODE="${CBM_SOAK_MODE:-default}"
6666
RESULTS_DIR="${RESULTS_DIR:-soak-results}"
6767
mkdir -p "$RESULTS_DIR"
6868

69+
# One latency ceiling judges a slow call (Check 4 below). The per-call read
70+
# waits past it, so the measured latency, not the read timeout, gives the
71+
# verdict; a reply that never comes still ends the read. GitHub's
72+
# windows-11-arm image (2026-10) answers the PowerShell-backed search_code in
73+
# ~23 s per call (1.1 s for v0.11.0 and v0.12.0 alike on a local Windows ARM64
74+
# VM), and the old fixed 30 s read failed that leg on one borderline call while
75+
# the 60 s ceiling itself held.
76+
SOAK_MAX_QUERY_LATENCY_S=60
77+
SOAK_CALL_READ_TIMEOUT_S=$((SOAK_MAX_QUERY_LATENCY_S + 30))
78+
6979
# Every product process below must reach a daemon rendezvous this run owns.
7080
# Only CBM_RUNTIME_DIR moves that rendezvous — a private CBM_CACHE_DIR alone
7181
# still shares the operator's account daemon (#1691, #1696).
@@ -502,12 +512,13 @@ mcp_call() {
502512
# Send request to server stdin
503513
echo "$req" >&3
504514

505-
# Read and validate one response (wait up to 30s). A JSON-RPC error or
506-
# tool-level isError is a failed operation, not a successful round-trip.
515+
# Read and validate one response (wait past the latency ceiling, see
516+
# SOAK_CALL_READ_TIMEOUT_S). A JSON-RPC error or tool-level isError is a
517+
# failed operation, not a successful round-trip.
507518
local resp=""
508519
local exit_code=1
509520
MCP_LAST_RESPONSE=""
510-
if read -r -t 30 resp <&4 2>/dev/null; then
521+
if read -r -t "$SOAK_CALL_READ_TIMEOUT_S" resp <&4 2>/dev/null; then
511522
MCP_LAST_RESPONSE="$resp"
512523
if json_rpc_response_ok "$id" "$resp"; then
513524
exit_code=0
@@ -947,9 +958,9 @@ fi
947958
MAX_LATENCY=$(awk -F, 'NR>1 && $2!="index_repository" { if ($3>max) max=$3 } END { print max+0 }' "$LATENCY_CSV")
948959
MAX_INDEX=$(awk -F, 'NR>1 && $2=="index_repository" { if ($3>max) max=$3 } END { print max+0 }' "$LATENCY_CSV")
949960
echo "Max query latency: ${MAX_LATENCY}ms (index: ${MAX_INDEX}ms)" | tee -a "$SUMMARY"
950-
# 60s threshold — MSYS2/Wine adds significant overhead to all operations
951-
if [ "${MAX_LATENCY:-0}" -gt 60000 ] 2>/dev/null; then
952-
echo "FAIL: max query latency ${MAX_LATENCY}ms > 60s" | tee -a "$SUMMARY"
961+
# SOAK_MAX_QUERY_LATENCY_S — MSYS2/Wine adds significant overhead to all operations
962+
if [ "${MAX_LATENCY:-0}" -gt $((SOAK_MAX_QUERY_LATENCY_S * 1000)) ] 2>/dev/null; then
963+
echo "FAIL: max query latency ${MAX_LATENCY}ms > ${SOAK_MAX_QUERY_LATENCY_S}s" | tee -a "$SUMMARY"
953964
PASS=false
954965
fi
955966

0 commit comments

Comments
 (0)