Skip to content

Commit 590dc21

Browse files
committed
review: CodeRabbit fixes — MD040 fence + curl timeouts on smoke
Two CodeRabbit follow-ups on PR #34: * tests/web-ui-qa-checklist.md: the fenced block describing the /api/generate-pdf probe was missing a language hint and tripped markdownlint MD040. Tagged as `text`. * tests/web-ui-smoke.sh: every curl call now goes through CURL_FLAGS=(--silent --show-error --connect-timeout 2 --max-time 5) so a stalled socket can't hang the script indefinitely. The boot-wait loop also redirects stderr to /dev/null because connection-refused during the polling phase is expected; if the wait times out, the final fall-through check re-runs with stderr visible so the failure reason is preserved. Verified: bash tests/web-ui-smoke.sh — 11/11 pass, no noise on stdout.
1 parent 7baff7d commit 590dc21

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

tests/web-ui-qa-checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ a file that opens cleanly in its native viewer.
208208
| `.csv` | 592 KB | 391 rows (1 header + 390 bubbles), 21 columns covering tokens, thinking, tool calls |
209209

210210
Backend endpoint check (run earlier in this QA pass):
211-
```
211+
```text
212212
POST /api/generate-pdf
213213
→ HTTP 200, Content-Type: application/pdf, %PDF-1.3 magic, %%EOF terminator
214214
```

tests/web-ui-smoke.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ set -u
1010

1111
PORT="${CLAW_QA_PORT:-3001}" # use 3001 so a running 3000 instance isn't disturbed
1212
BASE="http://127.0.0.1:${PORT}"
13+
# Per-call curl bounds — connection setup capped at 2s, total wall-clock at
14+
# 5s — so a stalled socket can't hang the script indefinitely.
15+
CURL_FLAGS=(--silent --show-error --connect-timeout 2 --max-time 5)
1316
LOG=$(mktemp)
1417
trap "rm -f $LOG" EXIT
1518

@@ -20,13 +23,15 @@ python3 app.py --port "$PORT" > "$LOG" 2>&1 &
2023
APP_PID=$!
2124
trap "kill $APP_PID 2>/dev/null; rm -f $LOG" EXIT
2225

23-
# Wait up to 15s for /api/workspaces to respond.
26+
# Wait up to 15s for /api/workspaces to respond. Connection-refused during
27+
# this loop is expected (app is still booting), so stderr is muted; the
28+
# final check below re-runs with stderr visible if the wait times out.
2429
for i in $(seq 1 30); do
25-
if curl -sf -o /dev/null "$BASE/api/workspaces"; then break; fi
30+
if curl "${CURL_FLAGS[@]}" -f -o /dev/null "$BASE/api/workspaces" 2>/dev/null; then break; fi
2631
sleep 0.5
2732
done
2833

29-
if ! curl -sf -o /dev/null "$BASE/api/workspaces"; then
34+
if ! curl "${CURL_FLAGS[@]}" -f -o /dev/null "$BASE/api/workspaces"; then
3035
echo "[FAIL] app never became responsive on $PORT"
3136
echo "--- boot log ---"; cat "$LOG"
3237
exit 1
@@ -36,7 +41,7 @@ fail=0
3641
probe() {
3742
local label="$1" url="$2" expect="$3"
3843
local code
39-
code=$(curl -s -o /dev/null -w "%{http_code}" "$BASE$url")
44+
code=$(curl "${CURL_FLAGS[@]}" -o /dev/null -w "%{http_code}" "$BASE$url")
4045
if [ "$code" = "$expect" ]; then
4146
printf " [pass] %-44s %s (expected %s)\n" "$label" "$code" "$expect"
4247
else
@@ -58,7 +63,7 @@ probe "/api/detect-environment" "/api/detect-environment" 200
5863
probe "/api/search?q=foo" "/api/search?q=foo" 200
5964
probe "/api/search (no q -> 400)" "/api/search" 400
6065

61-
WS_ID=$(curl -s "$BASE/api/workspaces" | python3 -c "
66+
WS_ID=$(curl "${CURL_FLAGS[@]}" "$BASE/api/workspaces" | python3 -c "
6267
import sys, json
6368
data = json.load(sys.stdin)
6469
for w in data:

0 commit comments

Comments
 (0)