Files
moby/integration-cli
Sebastiaan van Stijn 269960a4c6 integration-cli: TestConcurrentPush: refactor to improve failure logs
This tests, when failing, only produced a non-informative "exit status 1",
which limits investigating why it failed.

This patch:

- Rewrites the parallel pushes to use an error-group, and asserts each
  push to get the failure output of the command.
- Simplifies the Dockerfile that's used for building the test-image,
  removing steps that were not needed for the test.
- Adds a cleanup step to make sure the images are deleted after the
  test, or if the test fails (although the test-suite should already
  handle this).

Before this, a failure looked like:

    make BIND_DIR=. TEST_FILTER='TestConcurrentPush' test-integration-cli
    === FAIL: arm64.integration-cli TestDockerRegistrySuite/TestConcurrentPush (5.49s)
        docker_cli_push_test.go:159: assertion failed: error is not nil: exit status 1: concurrent push failed with error: exit status 1
        check_test.go:476: [dfa779e71fdf8] daemon is not started
        --- FAIL: TestDockerRegistrySuite/TestConcurrentPush (5.49s)

With this patch applied:

    make BIND_DIR=. TEST_FILTER='TestConcurrentPush' test-integration-cli
    === FAIL: arm64.integration-cli TestDockerRegistrySuite/TestConcurrentPush (2.47s)
        docker_cli_push_test.go:156: assertion failed:
            Command:  /usr/local/cli-integration/docker push 127.0.0.1:5000/dockercli/busybox:push2nosuch
            ExitCode: 1
            Error:    exit status 1
            Stdout:   The push refers to repository 127.0.0.1:5000/dockercli/busybox

            Stderr:   tag does not exist: 127.0.0.1:5000/dockercli/busybox:push2nosuch

            Failures:
            ExitCode was 1 expected 0
            Expected no error
        docker_cli_push_test.go:160: assertion failed: error is not nil: exit status 1
        check_test.go:476: [db77ef03a8fd8] daemon is not started
        --- FAIL: TestDockerRegistrySuite/TestConcurrentPush (2.47s)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-02 09:51:14 -05:00
..
2025-07-31 10:13:29 -07:00
2025-06-05 21:42:05 +00:00
2025-06-05 21:42:05 +00:00