Skip to content

Commit 6d16f48

Browse files
author
Shane Wall
committed
demo/postgres-survive-kill9/ci-smoke.sh: now waits for pgbench tables before taking the baseline, explicitly restarts the Postgres service after the SIGKILL, and re-uses the readiness loop. This matches your test flow.
Updated README earlier to surface ./ci-smoke.sh as the CI-friendly check. Tested: Ran ./ci-smoke.sh from demo/postgres-survive-kill9: passes (baseline captured, kill, restart, count preserved, metrics scraped), then tore down the stack.
1 parent c761b19 commit 6d16f48

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

demo/postgres-survive-kill9/ci-smoke.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,22 @@ if [[ "${ready}" != "1" ]]; then
2525
exit 1
2626
fi
2727

28+
# Wait for pgbench tables to exist (loader may still be initializing)
29+
echo "Waiting for pgbench tables..."
30+
for i in {1..30}; do
31+
if docker compose exec -T postgres psql -U postgres -d bench -t -A -c "SELECT 1 FROM pg_tables WHERE tablename='pgbench_history';" 2>/dev/null | grep -q 1; then
32+
break
33+
fi
34+
sleep 2
35+
done
36+
2837
baseline=$(docker compose exec -T postgres psql -U postgres -d bench -t -A -c "SELECT count(*) FROM pgbench_history;" 2>/dev/null || echo "0")
2938
echo "Baseline transactions: ${baseline}"
3039

3140
docker kill -s KILL "$(docker compose ps -q postgres)"
3241

3342
echo "Waiting for Postgres to restart..."
43+
# Explicitly restart to avoid edge cases where manual SIGKILL bypasses restart policy
3444
docker compose up -d postgres >/dev/null 2>&1
3545
ready=0
3646
for i in {1..30}; do

0 commit comments

Comments
 (0)