1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

int/build/TestBuildWithEmptyLayers: prevent panic

The test case panics like that:

> build_test.go:381: assertion failed: 3 (int) != 1 (int)
> panic: runtime error: index out of range [2] with length 1 [recovered]
> panic: runtime error: index out of range [2] with length 1

The fix is trivial.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2020-06-04 11:18:18 -07:00
parent 0a82354344
commit 9b77370213

View file

@ -378,7 +378,7 @@ RUN cat somefile`
imageIDs, err := getImageIDsFromBuild(out.Bytes())
assert.NilError(t, err)
assert.Check(t, is.Equal(3, len(imageIDs)))
assert.Assert(t, is.Equal(3, len(imageIDs)))
image, _, err := apiclient.ImageInspectWithRaw(context.Background(), imageIDs[2])
assert.NilError(t, err)