ci: dump regression.diffs on installcheck failure in the build image#1152
Open
dimitri wants to merge 1 commit into
Open
ci: dump regression.diffs on installcheck failure in the build image#1152dimitri wants to merge 1 commit into
dimitri wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
RUN pg_virtualenv ... make -C src/monitor/ installcheckfails during the Dockerbuildstage, the container running it is discarded on failure — sosrc/monitor/regression.diffs, the one file that actually shows what differed between expected and actual output, never makes it into the CI log. All CI (and anyone reading it later) gets is the postmaster log tail, which is often noise from unrelated concurrently-registered test fixtures and rarely points at the real cause.This came up directly while diagnosing recent regress failures on #1149/#1151: pinning down the actual cause required reproducing the build locally and temporarily hacking the Dockerfile to
catthe diffs file. That workaround is worth keeping permanently instead of redoing it by hand every time.Fix
On failure, find and
catevery*.diffsfile undersrc/monitor/(covers both theREGRESSandISOLATIONsuites, whereverpg_regress/pg_isolation_regresshappen to write them), then re-raise the original failure so the build still fails exactly as before.Verified
make build-pg18:main) is unaffected — clean build, no output changes.expected/create_extension.out's output locally, rebuilt, confirmed the diff appears directly in the build log (both in the final failure dump and in buildx's error-context excerpt), then reverted the deliberate corruption.