Skip to content

feat(critest): Add image manager consistency and idempotency tests#1959

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:masterfrom
SergeyKanzhelev:imageTests
Feb 27, 2026
Merged

feat(critest): Add image manager consistency and idempotency tests#1959
k8s-ci-robot merged 1 commit into
kubernetes-sigs:masterfrom
SergeyKanzhelev:imageTests

Conversation

@SergeyKanzhelev

Copy link
Copy Markdown
Member

Adds a new test suite in to validate the idempotency and immediate consistency of CRI image operations.

This suite includes tests to ensure:

  • An image is available in ListImages and ImageStatus immediately after being pulled.
  • An image is absent from ListImages and ImageStatus immediately after being removed.
  • Concurrent RemoveImage calls for the same image are handled gracefully without errors, and the image is confirmed to be removed immediately after each call returns.

Additionally, this commit enhances the existing Image Manager test suite in with tests for removing images that have multiple tags, including tags that point to the same image digest from different registry domains (e.g., registry.k8s.io and its k8s.gcr.io mirror). The tests are written to be resilient to other images pre-existing on the test environment.

/kind feature

This code was generated by Gemini

Special notes for your reviewer:

Follow up from #1911

Does this PR introduce a user-facing change?

New tests for critest to validate the image operation consistency.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 11, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 11, 2025
@SergeyKanzhelev
SergeyKanzhelev force-pushed the imageTests branch 2 times, most recently from 1f29cec to c042889 Compare December 12, 2025 22:29
Comment thread pkg/validate/image_consistency.go
@saschagrunert

Copy link
Copy Markdown
Member

@SergeyKanzhelev do you mind a rebase?

Comment thread pkg/validate/image_consistency.go Outdated
@SergeyKanzhelev

Copy link
Copy Markdown
Member Author

Failures seems not related to this PR.

@SergeyKanzhelev

Copy link
Copy Markdown
Member Author

@saschagrunert can you please try rerun tests? Failures seem unrelated. If passing - this is OK to merge

@saschagrunert

Copy link
Copy Markdown
Member

Tests are green now, that one containerd test flakes all the time on windows.

@SergeyKanzhelev

Copy link
Copy Markdown
Member Author

Tests are green now, that one containerd test flakes all the time on windows.

@saschagrunert are you ok to merge this?

@saschagrunert

Copy link
Copy Markdown
Member

@SergeyKanzhelev yes, but please rebase it once again

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 26, 2026
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 26, 2026
@SergeyKanzhelev

Copy link
Copy Markdown
Member Author

rebased, waiting for tests

Adds a new test suite in  to validate the idempotency and immediate consistency of CRI image operations.

This suite includes tests to ensure:
- An image is available in ListImages and ImageStatus immediately after being pulled.
- An image is absent from ListImages and ImageStatus immediately after being removed.
- Concurrent RemoveImage calls for the same image are handled gracefully without errors, and the image is confirmed to be removed immediately after each call returns.

Additionally, this commit enhances the existing Image Manager test suite in  with tests for removing images that have multiple tags, including tags that point to the same image digest from different registry domains (e.g., registry.k8s.io and its k8s.gcr.io mirror). The tests are written to be resilient to other images pre-existing on the test environment.

var defaultRuntimeEndpoints = []string{"npipe:////./pipe/containerd-containerd", "npipe:////./pipe/cri-dockerd"}
var defaultConfigPath string
var (

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this was done by golangci-lint fmt. Not sure why formatter is not aligned with run --fix, but included it here so it will not complain any longer

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 27, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: saschagrunert, SergeyKanzhelev

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 27, 2026
@k8s-ci-robot
k8s-ci-robot merged commit 4bf8aed into kubernetes-sigs:master Feb 27, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants