fix(ci): stop the image smoke test racing on SIGPIPE under pipefail
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5f50a3acce
commit
15e70b5003
2 files changed
+12
-3
No files matched your search
@@ -6,6 +6,9 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versio
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- The image smoke test piped `curl` and `acaua doctor` into `grep -q` under `pipefail`; `grep` exits at the first match, the writer can get SIGPIPE, and the step failed at random (it already broke Xexéu's arm64 build). Outputs are now captured before checking.
|
||||||
|
|
||||||
## [0.1.0] - 2026-11-01
|
## [0.1.0] - 2026-11-01
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -17,9 +17,15 @@ for _ in $(seq 1 30); do
|
|||||||
docker exec "$name" curl -fsS http://127.0.0.1:8787/api/health >/dev/null 2>&1 && break
|
docker exec "$name" curl -fsS http://127.0.0.1:8787/api/health >/dev/null 2>&1 && break
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
docker exec "$name" curl -fsS http://127.0.0.1:8787/api/health | grep -q '"status":"ok"' || fail "/api/health did not answer"
|
# Capture output instead of piping into `grep -q`: grep exits at the first match,
|
||||||
docker exec "$name" curl -fsS http://127.0.0.1:8787/ | grep -qi '<!doctype html' || fail "dashboard is not served"
|
# the writer gets SIGPIPE and `pipefail` turns that into a flaky failure.
|
||||||
docker exec "$name" acaua doctor --json | grep -A1 '"name": "duckdb"' | grep -q '"ok": true' || fail "libduckdb is not usable"
|
out=$(docker exec "$name" curl -fsS http://127.0.0.1:8787/api/health) || fail "/api/health did not answer"
|
||||||
|
grep -q '"status":"ok"' <<<"$out" || fail "/api/health is not ok"
|
||||||
|
out=$(docker exec "$name" curl -fsS http://127.0.0.1:8787/) || fail "dashboard did not answer"
|
||||||
|
grep -qi '<!doctype html' <<<"$out" || fail "dashboard is not served"
|
||||||
|
out=$(docker exec "$name" acaua doctor --json) || { echo "$out" >&2; fail "acaua doctor --json failed"; }
|
||||||
|
duckdb=$(grep -A1 '"name": "duckdb"' <<<"$out") || true
|
||||||
|
grep -q '"ok": true' <<<"$duckdb" || { echo "$out" >&2; fail "libduckdb is not usable"; }
|
||||||
[ "$(docker inspect -f '{{if .Config.Healthcheck}}yes{{end}}' "$name")" = yes ] || fail "image has no HEALTHCHECK"
|
[ "$(docker inspect -f '{{if .Config.Healthcheck}}yes{{end}}' "$name")" = yes ] || fail "image has no HEALTHCHECK"
|
||||||
[ "$(docker exec "$name" id -u)" != 0 ] || fail "daemon runs as root"
|
[ "$(docker exec "$name" id -u)" != 0 ] || fail "daemon runs as root"
|
||||||
docker stop -t 10 "$name" >/dev/null
|
docker stop -t 10 "$name" >/dev/null
|
||||||
|
|||||||
Reference in new issue
Block a user