Skip to content

Commit 4ab1d59

Browse files
motxxclaude
andcommitted
fix: poll /health during pentest server startup
sleep 3 was too tight on cold CI runners — tailwind CSS build and Deno cache warmup push server boot past 3s. Use the existing wait_for_service helper (up to 30s) so we only fail when the server genuinely can't start. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
1 parent 25d58ce commit 4ab1d59

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

scripts/test-all.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,10 @@ run_pentest() {
7575
HTTP_API_KEYS=pentest-key-001 PORT=$port \
7676
deno run --allow-all src/infrastructure/server.ts &
7777
local server_pid=$!
78-
sleep 3
7978

80-
# Verify server is up
81-
if ! curl -sf "http://localhost:$port/health" > /dev/null 2>&1; then
82-
echo " Server failed to start on port $port"
79+
# Poll /health for up to 30s — CI cold-start (tailwind CSS build + Deno cache)
80+
# can exceed 3s on a fresh runner.
81+
if ! wait_for_service "pentest server" "http://localhost:$port/health" 15; then
8382
kill $server_pid 2>/dev/null || true
8483
fail "pentest server start"
8584
return

0 commit comments

Comments
 (0)