Skip to content

test(e2e): pull container images on-demand for filtered test runs - #1041

Open
Nachiket-Roy wants to merge 1 commit into
urunc-dev:mainfrom
Nachiket-Roy:fix/test-image
Open

Nachiket-Roy wants to merge 1 commit into
urunc-dev:mainfrom
Nachiket-Roy:fix/test-image

Conversation

@Nachiket-Roy

@Nachiket-Roy Nachiket-Roy commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description

The e2e test suite unconditionally pulled every container image declared across the entire test suite in BeforeAll (even when filtering via make test_nerdctl_Spt or running ARM64 CI/CD jobs). The test framework now:

  • Pulls images on-demand only when a matching spec executes
  • Preserves pre-existing host images
  • Uses singleflight to eliminate TOCTOU races
  • Enforces suite serialization
  • Isolates lock domains

Related issues

How was this tested?

  1. Build and Compilation

    go build ./... && go test -c ./tests/e2e -o /dev/null

    The entire codebase and e2e test harness compile cleanly without errors.

  2. Full Unit Test Suite

    make unittest

    All unit tests across pkg/network, pkg/unikontainers, pkg/unikontainers/hypervisors, pkg/unikontainers/initrd, pkg/unikontainers/unikernels, and internal/metrics passed with zero errors.

  3. Filtered Dry‑Run Verification

    go test ./tests/e2e -v -run TestE2E --ginkgo.focus="Nerdctl.*Spt" --ginkgo.dry-run

    Output:

    Will run 4 of 75 specs
    SSSSSSSSSSSSSSSSSSS•SSSSSSS•••SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
    Ran 4 of 75 Specs in 0.002 seconds
    SUCCESS! -- 4 Passed | 0 Failed | 0 Pending | 71 Skipped
    

    Only the 4 matching specs were targeted, and no unneeded images from the remaining 71 test cases were queued or pulled.

LLM usage

Gemini 3.8

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

The end-to-end test suite previously pulled all declared container images
in BeforeAll regardless of test filters. When executing a filtered subset
of tests (such as make test_nerdctl_Spt or ARM64 CI/CD jobs), this incurred
substantial network latency, bandwidth usage, and pull flakiness.

Transition to on-demand image pulling by verifying and pulling container
images only when a spec is executed:
- Implement ensureImage using singleflight to eliminate race conditions.
- Implement imageExists via quiet listing queries (<tool> images -q) to
  detect pre-existing host images without version-sensitive stderr scraping.
- Preserve pre-existing host images so only images downloaded during the
  run are removed on cleanup, and add URUNC_E2E_KEEP_IMAGES support.
- Split cross-process file locking into containerd-k8s.io and docker
  domains to avoid unnecessary serialization.
- Add Ginkgo Serial decorator to all tool suites and enforce fail-fast
  image checks before allocating pod or container resources.

Fixes urunc-dev#1037

Signed-off-by: Nachiket Roy <nachiket.roy.2@gmail.com>
@netlify

netlify Bot commented Sep 9, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 8ccfc28
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6aa1ced345233700083834b2

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.

PUll only the images to test

1 participant