Skip to content

test: pull image in setup for TestRunUmask and TestRunUserGID#4998

Open
mayur-tolexo wants to merge 1 commit into
containerd:mainfrom
mayur-tolexo:fix/run-image-tests-pull-setup
Open

test: pull image in setup for TestRunUmask and TestRunUserGID#4998
mayur-tolexo wants to merge 1 commit into
containerd:mainfrom
mayur-tolexo:fix/run-image-tests-pull-setup

Conversation

@mayur-tolexo

Copy link
Copy Markdown

TestRunUmask and TestRunUserGID use AlpineImage but never pull it, so they rely on run --pull missing finding it in the content store. The content store is shared across the parallel integration tests, and when a concurrent test prunes/GCs a layer blob while the image manifest is still around, run treats the image as present and skips the fetch. It then fails with content digest <sha> not found.

Saw this on the almalinux-8 rootless lane:

nerdctl run --rm --umask 0200 ghcr.io/stargz-containers/alpine:3.13-org sh -c umask
level=fatal msg="content digest sha256:ec14c7992a97fc11425907e908340c6c3d6ff602f5f13d899e6b7027c9b4133a: not found"
--- FAIL: TestRunUmask (0.17s)

The fix pulls the image in Setup, the same thing TestRunAddGroup_CVE_2023_25173 already does. pull re-fetches any missing blobs, so the store is consistent before the run.

Both tests use AlpineImage but never pull it, relying on the default
run --pull missing behavior. When the image manifest is already in the
shared content store but a layer blob has been removed by a concurrent
test's prune/GC, run sees the image as present and skips the fetch, so
it fails with "content digest <sha> not found".

Pull the image in Setup, matching the existing pattern in
TestRunAddGroup_CVE_2023_25173. pull re-fetches any missing blobs, so
the store is repaired before the run.

Signed-off-by: Mayur Das <mayur.das@neevcloud.com>
func TestRunUserGID(t *testing.T) {
testCase := nerdtest.Setup()
testCase.Setup = func(data test.Data, helpers test.Helpers) {
helpers.Ensure("pull", "--quiet", testutil.AlpineImage)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we rather de-parallelize the test that removes the alpine image?
Otherwise we will need to duplicate this Setup function to almost all the tests?

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.

2 participants