Skip to content

Commit 3428b12

Browse files
authored
Merge pull request DeusData#1288 from DeusData/feat/local-remote-parity
Cycle-4 dry-run fixes: real Phase-15 UI probe, header-only readiness, 30s diagnostics window
2 parents d0e1ac5 + 657d4b0 commit 3428b12

4 files changed

Lines changed: 41 additions & 18 deletions

File tree

‎scripts/smoke-local.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ READY=0
161161
for _ in $(seq 1 100); do
162162
if [ -s "$PORT_FILE" ]; then
163163
PORT=$(tr -d '[:space:]' < "$PORT_FILE")
164-
if curl --noproxy '*' -fsS \
164+
# Header-only readiness (see vm-smoke.sh): proves routing without a
165+
# full body transfer per poll; the download phases own body transport.
166+
if curl --noproxy '*' -fsSI \
165167
"http://127.0.0.1:$PORT/$EXPECTED_ARTIFACT" >/dev/null 2>&1; then
166168
READY=1
167169
break

‎scripts/smoke-test.sh‎

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3362,17 +3362,26 @@ echo "=== Phase 15: UI HTTP server ==="
33623362
# port made the whole phase read as SKIP. The tiny TOCTOU window between
33633363
# probe and bind is the residual risk, not the common case.
33643364
UI_PORT=$(python3 -c 'import socket; s = socket.socket(); s.bind(("127.0.0.1", 0)); print(s.getsockname()[1]); s.close()')
3365-
UI_INPUT=$(smoke_mktemp_file)
3366-
"$BINARY" --port "$UI_PORT" < "$UI_INPUT" > /dev/null 2>&1 &
3365+
# --ui=true is REQUIRED: the HTTP UI is a persisted, default-off setting, so
3366+
# on any fresh profile (every CI runner, every smoke HOME) a bare --port
3367+
# invocation can never serve — the probe then misread "UI disabled" as "no
3368+
# embedded assets" on binaries that carry them (first exposed when the
3369+
# ui-variant no-skip guard made Phase 15 mandatory). Stdin must be HELD OPEN:
3370+
# the UI does not pin the process, so stdio EOF ends it cleanly (rc=0) before
3371+
# the poll can see it serve — the drive-listing guard holds a pipe for the
3372+
# same reason. Equals-form flags match that guard's proven invocation.
3373+
sleep 300 | "$BINARY" --ui=true --port="$UI_PORT" > /dev/null 2>&1 &
33673374
UI_PID=$!
33683375
# Readiness poll instead of a fixed sleep: SKIP is legitimate ONLY when the
33693376
# process exited (the documented no-embedded-assets case); a slow start on a
3370-
# loaded runner must not masquerade as it.
3377+
# loaded runner must not masquerade as it. The UI binds ~6s after launch even
3378+
# on a fast host (measured against the release artifact), so the window
3379+
# matches the drive-listing guard's 25s, not a 10s sprint.
33713380
UI_READY=0
3372-
for _ in $(seq 1 100); do
3381+
for _ in $(seq 1 150); do
33733382
if ! kill -0 "$UI_PID" 2>/dev/null; then break; fi
33743383
if curl -sf "http://127.0.0.1:$UI_PORT/" -o /dev/null 2>/dev/null; then UI_READY=1; break; fi
3375-
sleep 0.1
3384+
sleep 0.2
33763385
done
33773386

33783387
if [ "$UI_READY" -eq 1 ] || kill -0 "$UI_PID" 2>/dev/null; then
@@ -3388,17 +3397,18 @@ if [ "$UI_READY" -eq 1 ] || kill -0 "$UI_PID" 2>/dev/null; then
33883397
exit 1
33893398
fi
33903399

3391-
# 15b: POST /rpc accepts JSON-RPC and returns JSON
3392-
RPC_BODY=$(curl -sf -X POST \
3393-
-H "Content-Type: application/json" \
3394-
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' \
3395-
"http://127.0.0.1:$UI_PORT/rpc" 2>/dev/null || echo "")
3396-
if echo "$RPC_BODY" | grep -q "jsonrpc"; then
3397-
echo "OK 15b: /rpc returns JSON-RPC response"
3400+
# 15b: the API surface answers — GET /api/ui-config is stateless and
3401+
# session-free, so it proves API reachability on any fresh profile. (The
3402+
# old probe POSTed an MCP initialize at /rpc, but the UI's /rpc speaks the
3403+
# UI's own narrow query protocol, not MCP — the probe asserted a request
3404+
# the endpoint never answered; protocol depth belongs to the UI guards.)
3405+
RPC_BODY=$(curl -sf "http://127.0.0.1:$UI_PORT/api/ui-config" 2>/dev/null || echo "")
3406+
if echo "$RPC_BODY" | grep -q "{"; then
3407+
echo "OK 15b: /api/ui-config returns JSON"
33983408
elif [ -z "$RPC_BODY" ]; then
3399-
smoke_ui_missing "15b" "/rpc not reachable"
3409+
smoke_ui_missing "15b" "/api/ui-config not reachable"
34003410
else
3401-
echo "FAIL 15b: /rpc did not return JSON-RPC"
3411+
echo "FAIL 15b: /api/ui-config did not return JSON"
34023412
kill "$UI_PID" 2>/dev/null || true
34033413
exit 1
34043414
fi
@@ -3408,7 +3418,6 @@ if [ "$UI_READY" -eq 1 ] || kill -0 "$UI_PID" 2>/dev/null; then
34083418
else
34093419
smoke_ui_missing "Phase 15" "binary exited immediately (no UI assets embedded)"
34103420
fi
3411-
rm -f "$UI_INPUT"
34123421

34133422
echo ""
34143423
echo "=== Phase 16: stdio server leaves no orphan after shutdown ==="

‎scripts/soak-test.sh‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,13 @@ wait_for_daemon_stop() {
559559
wait_for_diagnostics_snapshot() {
560560
local after_count="${1:-0}"
561561
local previous_path="${2:-}"
562-
local attempts=100
562+
# 30s, not a 10s sprint: the first snapshot lands one diagnostics interval
563+
# (5s) after start, and a cold 4-vCPU hosted runner mid-initial-index can
564+
# push the first WRITE past 10s (observed: both Windows runner soak legs
565+
# died right after 'server running' while the daemon's own log shows a
566+
# perfectly healthy diagnostics.start — the VM's 18 cores never miss the
567+
# window). Budget doctrine: the wait sits above the worst case.
568+
local attempts=300
563569
while [ "$attempts" -gt 0 ]; do
564570
local current_count
565571
current_count=$(diagnostics_start_count)

‎test-infrastructure/vm/vm-smoke.sh‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,13 @@ READY=0
186186
for _ in $(seq 1 100); do
187187
if [ -s "$PORT_FILE" ]; then
188188
PORT=$(tr -d '[:space:]' < "$PORT_FILE")
189-
if curl --noproxy '*' -fsS \
189+
# Header-only readiness: a HEAD proves the server routes the artifact
190+
# without transferring the archive body on every poll (hosted Windows
191+
# runners reset mid-body full-GET polls — WinError 10054 on the server,
192+
# 99 aborted transfers per job — while the same stack passes on the VM;
193+
# the real download phases still exercise full transfers and report
194+
# phase-precise if body transport is broken).
195+
if curl --noproxy '*' -fsSI \
190196
"http://127.0.0.1:$PORT/$EXPECTED_ARTIFACT" >/dev/null 2>&1; then
191197
READY=1
192198
break

0 commit comments

Comments
 (0)