Skip to content

Commit 8d51eb3

Browse files
author
Shane Wall
committed
The workflow was hitting the metrics endpoint too soon/from the host. I switched the metrics check to run inside the loader container (which now has curl installed) against http://postgres:9911/metrics. This avoids host-network timing issues.
Ensured the loader installs curl so that internal metrics check works. Files changed: demo/postgres-survive-kill9/docker-compose.yml: loader now installs curl alongside the postgres client. demo/postgres-survive-kill9/ci-smoke.sh: metrics wait uses docker compose exec -T loader curl http://postgres:9911/metrics and still waits up to ~4 minutes for readiness/tables/metrics.
1 parent 01b2c11 commit 8d51eb3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ wait_pgbench_tables() {
4040
wait_metrics() {
4141
echo "Waiting for metrics endpoint..."
4242
for _ in {1..120}; do
43-
if curl -sf http://localhost:9911/metrics | grep -q diffkeeper_recovery_total; then
43+
if docker compose exec -T loader curl -sf http://postgres:9911/metrics | grep -q diffkeeper_recovery_total; then
4444
return
4545
fi
4646
sleep 2

demo/postgres-survive-kill9/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ services:
2727
-c "
2828
set -euo pipefail;
2929
apt-get update -qq;
30-
apt-get install -y -qq postgresql-client postgresql-contrib;
30+
apt-get install -y -qq postgresql-client postgresql-contrib curl;
3131
until pg_isready -h "$$PGHOST" -U "$$PGUSER"; do sleep 1; done;
3232
createdb "$$PGDATABASE" || true;
3333
if ! psql -h "$$PGHOST" -U "$$PGUSER" -d "$$PGDATABASE" -tAc \"SELECT 1 FROM pg_tables WHERE tablename='pgbench_accounts'\" | grep -q 1; then

0 commit comments

Comments
 (0)