Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
18 changes: 2 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -392,22 +392,7 @@ jobs:
SQL

- name: Start Go server with fixture DB
run: |
fuser -k 13581/tcp 2>/dev/null || true
sleep 1
./corescope-server -port 13581 -db test-fixtures/e2e-fixture.db -public public-instrumented &
echo $! > .server.pid
for i in $(seq 1 30); do
if curl -sf http://localhost:13581/api/healthz > /dev/null 2>&1; then
echo "Server ready after ${i}s"
break
fi
if [ "$i" -eq 30 ]; then
echo "Server failed to start within 30s"
exit 1
fi
sleep 1
done
run: bash scripts/e2e-fresh-server.sh

- name: Run Playwright E2E tests (fail-fast)
run: |
Expand Down Expand Up @@ -665,6 +650,7 @@ jobs:
run_e2e_suite || {
echo "::warning::E2E suite failed - flake-guard retry once (issue #61)"
cp e2e-output.txt e2e-output.attempt1.txt 2>/dev/null || true
bash scripts/e2e-fresh-server.sh
run_e2e_suite
}

Expand Down
40 changes: 40 additions & 0 deletions scripts/e2e-fresh-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
# Restore the pristine E2E fixture, freshen its timestamps, and (re)start the
# server. The Packets page defaults to a 15-minute window, so fixture data goes
# stale ~15 min after freshen; every suite attempt needs its own fresh start.
# Run from the repo root.
set -euo pipefail

PORT="${E2E_PORT:-13581}"
DB="${E2E_DB:-test-fixtures/e2e-fixture.db}"
PRISTINE="${E2E_PRISTINE:-/tmp/e2e-fixture.pristine.db}"
PUBLIC_DIR="${E2E_PUBLIC:-public-instrumented}"
LOG="${E2E_SERVER_LOG:-server.log}"

# First call: snapshot the seeded fixture before the server ever opens it.
if [ ! -f "$PRISTINE" ]; then
sqlite3 "$DB" "PRAGMA wal_checkpoint(TRUNCATE);" >/dev/null 2>&1 || true
cp "$DB" "$PRISTINE"
fi

if [ -f .server.pid ]; then kill "$(cat .server.pid)" 2>/dev/null || true; fi
fuser -k "$PORT"/tcp 2>/dev/null || true
sleep 1

rm -f "$DB-wal" "$DB-shm"
cp "$PRISTINE" "$DB"
bash tools/freshen-fixture.sh "$DB"

./corescope-server -port "$PORT" -db "$DB" -public "$PUBLIC_DIR" >"$LOG" 2>&1 &
echo $! > .server.pid

for i in $(seq 1 180); do
if curl -sf "http://localhost:$PORT/api/healthz" >/dev/null 2>&1; then
echo "Server ready after ${i}s"
exit 0
fi
sleep 1
done
echo "Server failed to start within 180s" >&2
tail -n 50 "$LOG" >&2 || true
exit 1
Loading