mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Replace t.Fatal(err) with assert.NilError(err)
so that they are consistent with other places Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
parent
28b7824caa
commit
32f6aeee8a
2 changed files with 7 additions and 9 deletions
|
@ -11,6 +11,7 @@ import (
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/internal/test/daemon"
|
"github.com/docker/docker/internal/test/daemon"
|
||||||
"github.com/docker/docker/internal/testutil"
|
"github.com/docker/docker/internal/testutil"
|
||||||
|
"gotest.tools/assert"
|
||||||
"gotest.tools/skip"
|
"gotest.tools/skip"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -34,16 +35,13 @@ func TestImportExtremelyLargeImageWorks(t *testing.T) {
|
||||||
var tarBuffer bytes.Buffer
|
var tarBuffer bytes.Buffer
|
||||||
|
|
||||||
tw := tar.NewWriter(&tarBuffer)
|
tw := tar.NewWriter(&tarBuffer)
|
||||||
if err := tw.Close(); err != nil {
|
err := tw.Close()
|
||||||
t.Fatal(err)
|
assert.NilError(t, err)
|
||||||
}
|
|
||||||
imageRdr := io.MultiReader(&tarBuffer, io.LimitReader(testutil.DevZero, 8*1024*1024*1024))
|
imageRdr := io.MultiReader(&tarBuffer, io.LimitReader(testutil.DevZero, 8*1024*1024*1024))
|
||||||
|
|
||||||
_, err := client.ImageImport(context.Background(),
|
_, err = client.ImageImport(context.Background(),
|
||||||
types.ImageImportSource{Source: imageRdr, SourceName: "-"},
|
types.ImageImportSource{Source: imageRdr, SourceName: "-"},
|
||||||
"test1234:v42",
|
"test1234:v42",
|
||||||
types.ImageImportOptions{})
|
types.ImageImportOptions{})
|
||||||
if err != nil {
|
assert.NilError(t, err)
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ func TestEventsExecDie(t *testing.T) {
|
||||||
assert.Equal(t, m.Actor.Attributes["execID"], id.ID)
|
assert.Equal(t, m.Actor.Attributes["execID"], id.ID)
|
||||||
assert.Equal(t, m.Actor.Attributes["exitCode"], "0")
|
assert.Equal(t, m.Actor.Attributes["exitCode"], "0")
|
||||||
case err = <-errors:
|
case err = <-errors:
|
||||||
t.Fatal(err)
|
assert.NilError(t, err)
|
||||||
case <-time.After(time.Second * 3):
|
case <-time.After(time.Second * 3):
|
||||||
t.Fatal("timeout hit")
|
t.Fatal("timeout hit")
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ func TestEventsBackwardsCompatible(t *testing.T) {
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
t.Fatal(err)
|
assert.NilError(t, err)
|
||||||
}
|
}
|
||||||
if event.Status == "create" && event.ID == cID {
|
if event.Status == "create" && event.ID == cID {
|
||||||
containerCreateEvent = &event
|
containerCreateEvent = &event
|
||||||
|
|
Loading…
Reference in a new issue