Skip to content

test(e2e): fix TestPullFailure's daemon-specific error assertion - #14245

Merged
glours merged 1 commit into
docker:mainfrom
ricardobranco777:fix_TestPullFailure
Sep 23, 2026
Merged

glours merged 1 commit into
docker:mainfrom
ricardobranco777:fix_TestPullFailure

Conversation

@ricardobranco777

@ricardobranco777 ricardobranco777 commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

What I did

The exact pull-failure wording is daemon-backend dependent (classic graphdriver: "pull access denied for ..."; containerd image store: "...: not found"), and OutputMatches only checks stdout while the daemon's progress line is written to stderr. Assert the image name appears on stderr instead, which holds regardless of backend or wording.

Otherwise test fails in openQA like this:

https://openqa.opensuse.org/tests/6229600/logfile?filename=docker_compose-e2e-compose.txt

# Test messages # TestPullFailure
# failure: 

Failed
=== RUN   TestPullFailure
=== PAUSE TestPullFailure
=== CONT  TestPullFailure
    framework.go:172: WARNING: docker-model cli-plugin not found
    pull_test.go:60: Running command: docker compose version
    pull_test.go:60: scenario: pull must fail when a service image cannot be pulled (project e2e-pull-failure)
    pull_test.go:60: Running command: docker compose --project-name e2e-pull-failure down -v --remove-orphans --timeout 0
    pull_test.go:61: step: pull reports the denied image and fails — docker compose -f /tmp/TestPullFailure3138440652/003/compose.yaml --project-name e2e-pull-failure pull
Docker Compose version 5.5.1
    pull_test.go:61: scenario failed: pull must fail when a service image cannot be pulled
        project: e2e-pull-failure
        artifacts: /tmp/compose-e2e-artifacts/e2e-pull-failure (compose.yaml, full step outputs, events, logs)
        hint: rerun with E2E_KEEP_FAILED=1 to keep the project alive for inspection
        
        transcript:
          ✗ pull reports the denied image and fails — docker compose -f /tmp/TestPullFailure3138440652/003/compose.yaml --project-name e2e-pull-failure pull (exit 1, 980ms)
        
        failure: expected output contains "pull access denied for does_not_exists": not found in output
        
        --- output of failing step
         Image doesn_t_exists_either Pulling 
         Image alpine:3.15 Pulling 
         Image does_not_exists Pulling 
         Image alpine:3.15 Pulled 
         Image doesn_t_exists_either failed to resolve reference "docker.io/library/doesn_t_exists_either:latest": docker.io/library/doesn_t_exists_either:latest: not found 
         Image does_not_exists Error failed to resolve reference "docker.io/library/does_not_exists:latest": docker.io/library/does_not_exists:latest: not found
        time="2026-09-20T11:58:57-04:00" level=warning msg="WARNING: Some service image(s) must be built from source by running:\n    docker compose build can_build"
        Error response from daemon: failed to resolve reference "docker.io/library/does_not_exists:latest": docker.io/library/does_not_exists:latest: not found
        
        
        --- project containers
        CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
        
        --- engine events since scenario start
        
        
    scenario.go:141: Running command: docker compose --project-name e2e-pull-failure down -v --remove-orphans --timeout 0
    framework.go:145: Contents of config dir:
    framework.go:147:   - /tmp/TestPullFailure3138440652/001
    framework.go:147:   - /tmp/TestPullFailure3138440652/001/cli-plugins
    framework.go:147:   - /tmp/TestPullFailure3138440652/001/cli-plugins/docker-buildx
    framework.go:147:   - /tmp/TestPullFailure3138440652/001/cli-plugins/docker-compose
    framework.go:147:   - /tmp/TestPullFailure3138440652/001/cli-plugins/docker-scan
--- FAIL: TestPullFailure (1.31s)

Related issue

(not mandatory) A picture of a cute animal, if possible in relation to what you did

The exact pull-failure wording is daemon-backend dependent (classic
graphdriver: "pull access denied for ..."; containerd image store:
"...: not found"), and OutputMatches only checks stdout while the
daemon's progress line is written to stderr. Assert the image name
appears on stderr instead, which holds regardless of backend or
wording.

Signed-off-by: Ricardo Branco <rbranco@suse.de>
@ricardobranco777
ricardobranco777 marked this pull request as ready for review September 21, 2026 07:51
@ricardobranco777

Copy link
Copy Markdown
Contributor Author

Verification run: https://openqa.opensuse.org/tests/6230001

@glours glours 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.

LGTM, thanks

@glours
glours enabled auto-merge (rebase) September 23, 2026 14:04
@glours
glours merged commit c6dffb2 into docker:main Sep 23, 2026
59 checks passed
@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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