diff --git a/cli/command/container/run_test.go b/cli/command/container/run_test.go index 8cc0b1bdc1a8..00b0912abe34 100644 --- a/cli/command/container/run_test.go +++ b/cli/command/container/run_test.go @@ -16,8 +16,6 @@ import ( "github.com/moby/moby/api/types" "github.com/moby/moby/api/types/container" "github.com/moby/moby/client" - "github.com/moby/moby/client/pkg/progress" - "github.com/moby/moby/client/pkg/streamformatter" "github.com/spf13/pflag" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" @@ -129,7 +127,7 @@ func TestRunAttach(t *testing.T) { } // end stream from "container" so that we'll detach - conn.Close() + assert.NilError(t, conn.Close()) select { case cmdErr := <-cmdErrC: @@ -209,7 +207,7 @@ func TestRunAttachTermination(t *testing.T) { } assert.NilError(t, syscall.Kill(syscall.Getpid(), syscall.SIGTERM)) - conn.Close() + assert.NilError(t, conn.Close()) select { case <-killCh: @@ -245,20 +243,12 @@ func TestRunPullTermination(t *testing.T) { _ = server.Close() }) go func() { - id := test.RandomID()[:12] // short-ID - progressOutput := streamformatter.NewJSONProgressOutput(server, true) - for i := range 100 { + for range 100 { select { case <-ctx.Done(): assert.NilError(t, server.Close(), "failed to close imageCreateFunc server") return default: - assert.NilError(t, progressOutput.WriteProgress(progress.Progress{ - ID: id, - Message: "Downloading", - Current: int64(i), - Total: 100, - })) time.Sleep(100 * time.Millisecond) } } diff --git a/internal/jsonstream/display_test.go b/internal/jsonstream/display_test.go index b40679422a4d..813082e4f0b2 100644 --- a/internal/jsonstream/display_test.go +++ b/internal/jsonstream/display_test.go @@ -7,9 +7,6 @@ import ( "time" "github.com/docker/cli/cli/streams" - "github.com/docker/cli/internal/test" - "github.com/moby/moby/client/pkg/progress" - "github.com/moby/moby/client/pkg/streamformatter" "gotest.tools/v3/assert" ) @@ -23,23 +20,12 @@ func TestDisplay(t *testing.T) { }) go func() { - id := test.RandomID()[:12] // short-ID - progressOutput := streamformatter.NewJSONProgressOutput(server, true) - for i := range 100 { + for range 100 { select { case <-ctx.Done(): assert.NilError(t, server.Close(), "failed to close jsonmessage server") return default: - err := progressOutput.WriteProgress(progress.Progress{ - ID: id, - Message: "Downloading", - Current: int64(i), - Total: 100, - }) - if err != nil { - break - } time.Sleep(100 * time.Millisecond) } } @@ -50,8 +36,7 @@ func TestDisplay(t *testing.T) { done := make(chan error) go func() { - out := streams.NewOut(io.Discard) - done <- Display(streamCtx, client, out) + done <- Display(streamCtx, client, streams.NewOut(io.Discard)) }() cancelStream()