From fc64dc85039f04950a1c50ed2faa16b9b8e3e0b7 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 22 Jul 2026 13:49:26 +0200 Subject: [PATCH] ci: dump regression.diffs on installcheck failure in the build image The build stage's installcheck RUN happens inside an ephemeral Docker build container: when it fails, that container (and with it src/monitor/regression.diffs) is discarded, so a CI log only ever showed the postmaster log tail -- not the actual expected-vs-actual diff that would explain the failure. Diagnosing recent regress failures required reproducing locally with a throwaway Dockerfile edit just to see the diff; this makes that permanent instead. On failure, find and cat every *.diffs file under src/monitor/ (covers both the REGRESS and ISOLATION suites, wherever pg_regress/ pg_isolation_regress happen to write them) before re-raising the original failure. Verified locally with `make build-pg18`: the success path is unaffected (clean build, no output changes); deliberately corrupting an expected file's output shows the diff appears in the build log, both in the final failure dump and in buildx's error-context excerpt. --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 116d00961..76b731493 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,9 +42,14 @@ RUN if [ -d src/bin/pgaftest ]; then \ fi RUN make -s clean && make -s install -j$(nproc) BINDIR=/usr/local/bin +# On failure, dump every *.diffs file: the container (and with it +# src/monitor/regression.diffs) is discarded once the build fails, so this +# is the only way a CI log ends up showing what actually differed instead +# of just the postmaster log tail. RUN pg_virtualenv -v ${PGVERSION} \ -o "shared_preload_libraries=pgautofailover" \ - make -C src/monitor/ installcheck + make -C src/monitor/ installcheck || \ + (find src/monitor -name '*.diffs' -exec cat {} +; exit 1) # --------------------------------------------------------------------------- # test — old Python test runner (kept for compatibility; new tests use pgaftest)