Repository navigation
integration/build: check build errors - #53880
Merged
Merged
Conversation
kolyshkin
requested review from
thaJeztah and
vvoland
and removed request for
vvoland
October 7, 2026 18:50
vvoland
approved these changes
Oct 7, 2026
vvoland
left a comment
Contributor
There was a problem hiding this comment.
LGTM.
These could probably also be refactored to use the build.Do helper:
moby/integration/internal/build/build.go
Lines 18 to 32 in a2a604e
Contributor
|
Needs linter fixes |
The build errors are reported in the response stream, and io.Copy does not check for those, so a test that only reads the build response with io.Copy passes even if the build fails. Add readBuildResponse helper, which copies the stream as is (so that the tests parsing the raw stream keep working), and returns an error if the stream contains one. Use it instead of io.Copy. TestBuildWCOWSandboxSize is left as is, since it tolerates a specific build failure. Signed-off-by: Kir Kolyshkin <[email protected]>
kolyshkin
force-pushed
the
integration-build-check-errors
branch
from
October 8, 2026 04:50
b22897b to
058c26f
Compare
Contributor
Author
Same, this was caused by a bad base/master. Rebased. |
Use build.Do helper in tests which only need the build to succeed, instead of open-coding it. The helper checks for build errors, and also removes the built image on cleanup. While at it, use buildtypes alias for api/types/build, as is done elsewhere, since the build name is now taken. Signed-off-by: Kir Kolyshkin <[email protected]>
Contributor
Author
@vvoland some of them, yes. Added a second commit, PTAL |
Contributor
|
integration-flaky failures can be ignored - this PR changes a lot of build related tests and running them all multiple times drains the runner disk space. |
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.
Summary
Build errors are reported in the build response stream, and
io.Copydoesnot check for those, so a test that only reads the build response with
io.Copypasses even if the build fails. This was found in #53859, whereTestBuildPreserveOwnershipwas silently passing in the userns CI modewhile the build was failing (that test is fixed in #53859, and so it is
not touched here).
This adds a
readBuildResponsehelper, which copies the stream as is (sothe tests parsing the raw JSON stream, like
getImageIDsFromBuildandreadBuildImageIDsusers, keep working), and returns an error if thestream contains one. All the other
io.Copycalls inintegration/buildare replaced with it, except for
TestBuildWCOWSandboxSize, whichtolerates a specific build failure (and is skipped anyway).
Many of the affected tests also inspect the resulting image afterwards,
so they would catch a failed build anyway, but not all of them do (for
example,
TestBuildWithEmptyLayersorTestBuildUncleanTarFilenames).The second commit (suggested by @vvoland) switches the tests that only
need the build to succeed to the
build.Dohelper, which also checksfor build errors. The rest still use
readBuildResponse, as they needthe build output, use a hand-crafted build context, or expect a build
error to be returned rather than failing the test.
AI disclosure: this change was done with Claude Code, and reviewed by me.
Release notes (optional)