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:
Yong Tang 2019-01-13 21:36:25 +00:00
parent 28b7824caa
commit 32f6aeee8a
2 changed files with 7 additions and 9 deletions

View File

@ -11,6 +11,7 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/internal/test/daemon"
"github.com/docker/docker/internal/testutil"
"gotest.tools/assert"
"gotest.tools/skip"
)
@ -34,16 +35,13 @@ func TestImportExtremelyLargeImageWorks(t *testing.T) {
var tarBuffer bytes.Buffer
tw := tar.NewWriter(&tarBuffer)
if err := tw.Close(); err != nil {
t.Fatal(err)
}
err := tw.Close()
assert.NilError(t, err)
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: "-"},
"test1234:v42",
types.ImageImportOptions{})
if err != nil {
t.Fatal(err)
}
assert.NilError(t, err)
}

View File

@ -63,7 +63,7 @@ func TestEventsExecDie(t *testing.T) {
assert.Equal(t, m.Actor.Attributes["execID"], id.ID)
assert.Equal(t, m.Actor.Attributes["exitCode"], "0")
case err = <-errors:
t.Fatal(err)
assert.NilError(t, err)
case <-time.After(time.Second * 3):
t.Fatal("timeout hit")
}
@ -109,7 +109,7 @@ func TestEventsBackwardsCompatible(t *testing.T) {
if err == io.EOF {
break
}
t.Fatal(err)
assert.NilError(t, err)
}
if event.Status == "create" && event.ID == cID {
containerCreateEvent = &event