Merge pull request 'Fix SIGPIPE race in the image smoke test' (#1) from fix/smoke-sigpipe into main
Release / Plan (reuse the published image?) (push) Successful in 8s
Release / ci (push) Skipped
Release / Build image (amd64) (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Publish tags (push) Successful in 19s
Release / Gitea release (push) Skipped

This commit was merged in pull request #1.
This commit is contained in:
lucasrguerra committed 2026-11-03 14:50:39 +00:00
commit b9b0e96225
3 files changed
+15 -3

No files matched your search

+3
View File
@@ -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
+3
View File
@@ -6,6 +6,9 @@ Formato baseado no [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/);
## [Unreleased] ## [Unreleased]
### Corrigido
- O smoke test da imagem passava a saída de `curl` e `acaua doctor` por pipe para `grep -q` sob `pipefail`; o `grep` sai no primeiro acerto, quem escreve pode levar SIGPIPE e o passo falhava ao acaso (isso já quebrou o build arm64 do Xexéu). As saídas agora são capturadas antes da checagem.
## [0.1.0] - 2026-11-01 ## [0.1.0] - 2026-11-01
### Adicionado ### Adicionado
+9 -3
View File
@@ -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