Skip to content

tests: fix "chroot with overlay root" flake - #6970

Merged
nalind merged 1 commit into
podman-container-tools:mainfrom
Luap99:fix-flake
Jul 17, 2026
Merged

tests: fix "chroot with overlay root" flake#6970
nalind merged 1 commit into
podman-container-tools:mainfrom
Luap99:fix-flake

Conversation

@Luap99

@Luap99 Luap99 commented Jul 17, 2026

Copy link
Copy Markdown
Member

What type of PR is this?

What this PR does / why we need it:

I have seen this fail twice on onf of my PRs. The problems is chown -R is currently not safe against concurrent removal of files and will report ENOENT errors which make it exit 1 and fail the test. However since it actually still chown's all files even when it fails we can ignore the failure here.

In the test context in particular thew problem is we have the full / as lower dir so any host file removals in /var/lib/containers can make this fail. Because the blob info cache uses a global path of var/lib/containers/cache/blob-info-cache-v1.sqlite regardless of the per test root/runroot and sqlite transactions will create and remove the blob-info-cache-v1.sqlite-journal many times we have a good chance to hit the race.

So we see failures like this:
chown: changing ownership of '/tmp/buildah_tests.vrbqgx/chroot/merged/var/lib/containers/cache/blob-info-cache-v1.sqlite-journal

The linked issues also shows a standalone coreutils reproducer to prove this is a problem there.

How to verify it

Which issue(s) this PR fixes:

Fixes: #6967

Special notes for your reviewer:

I plan to submit a bug report against coreutils and hopefully fix this properly there but this will take more time and it would take a long time until a new coreutils would land in our CI images anyway so this here seems the simplest to fix this for now and repduce some flakes.

Does this PR introduce a user-facing change?

None

I have seen this fail twice on onf of my PRs. The problems is chown -R
is currently not safe against concurrent removal of files and will
report ENOENT errors which make it exit 1 and fail the test. However
since it actually still chown's all files even when it fails we can
ignore the failure here.

In the test context in particular thew problem is we have the full / as
lower dir so any host file removals in /var/lib/containers can make this
fail. Because the blob info cache uses a global path of
var/lib/containers/cache/blob-info-cache-v1.sqlite regardless of the per
test root/runroot and sqlite transactions will create and remove the
blob-info-cache-v1.sqlite-journal many times we have a good chance to
hit the race.

So we see failures like this:
chown: changing ownership of '/tmp/buildah_tests.vrbqgx/chroot/merged/var/lib/containers/cache/blob-info-cache-v1.sqlite-journal

The linked issues also shows a standalone coreutils reproducer to prove
this is a problem there.

Fixes: podman-container-tools#6967

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@TomSweeneyRedHat

Copy link
Copy Markdown
Contributor

LGTM
restarted tests that appeared to be flakes.

@nalind nalind left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable.

@nalind
nalind enabled auto-merge July 17, 2026 19:23
@nalind
nalind merged commit 7c166bb into podman-container-tools:main Jul 17, 2026
58 of 64 checks passed
@Luap99
Luap99 deleted the fix-flake branch July 17, 2026 21:45
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.

test "chroot with overlay root" flakes

3 participants