Skip to content

inttests/build: make non-deterministic test pass#92

Open
chmeliik wants to merge 1 commit intokonflux-ci:mainfrom
chmeliik:fix-build-test
Open

inttests/build: make non-deterministic test pass#92
chmeliik wants to merge 1 commit intokonflux-ci:mainfrom
chmeliik:fix-build-test

Conversation

@chmeliik
Copy link
Copy Markdown
Contributor

@chmeliik chmeliik commented Apr 2, 2026

In c77c517, the assumption was that when the containerfile has duplicate stages, FROM instructions match the last stage with the same name.

This assumption was not quite correct: it appears that the behavior is not deterministic. Sometimes, the test fails because buildah decides to use the first stage1 instead of the second, and then the expected labels don't match.

We have no way to fix label injection to match buildah in this case, since we have to determine the labels ahead of time and we can't guess which of the stages buildah will choose to use. This will be a bug until the upstream buildah issue (see c77c517) is fixed.

Drop the duplicate stage1 from the test until that happens so that we don't have failing tests.

In c77c517, the assumption was that
when the containerfile has duplicate stages, FROM instructions match the
last stage with the same name.

This assumption was not quite correct: it appears that the behavior is
not deterministic. Sometimes, the test fails because buildah decides to
use the first stage1 instead of the second, and then the expected labels
don't match.

We have no way to fix label injection to match buildah in this case,
since we have to determine the labels ahead of time and we can't guess
which of the stages buildah will choose to use. This will be a bug until
the upstream buildah issue (see c77c517) is fixed.

Drop the duplicate stage1 from the test until that happens so that we
don't have failing tests.

Signed-off-by: Adam Cmiel <acmiel@redhat.com>
@chmeliik chmeliik requested a review from a team as a code owner April 2, 2026 16:02
@qodo-code-review
Copy link
Copy Markdown

qodo-code-review bot commented Apr 2, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@snyk-io
Copy link
Copy Markdown

snyk-io bot commented Apr 2, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant