diff --git a/buildfile_test.go b/buildfile_test.go index 1b3eb5818..e64b10866 100644 --- a/buildfile_test.go +++ b/buildfile_test.go @@ -2,6 +2,7 @@ package docker import ( "io/ioutil" + "sync" "testing" ) @@ -92,7 +93,12 @@ func TestBuild(t *testing.T) { } defer nuke(runtime) - srv := &Server{runtime: runtime} + srv := &Server{ + runtime: runtime, + lock: &sync.Mutex{}, + pullingPool: make(map[string]struct{}), + pushingPool: make(map[string]struct{}), + } buildfile := NewBuildFile(srv, ioutil.Discard) if _, err := buildfile.Build(mkTestContext(ctx.dockerfile, ctx.files, t)); err != nil { diff --git a/runtime_test.go b/runtime_test.go index 61a8f346f..f6235e8c5 100644 --- a/runtime_test.go +++ b/runtime_test.go @@ -135,10 +135,13 @@ func GetTestImage(runtime *Runtime) *Image { imgs, err := runtime.graph.All() if err != nil { panic(err) - } else if len(imgs) < 1 { - panic("GASP") } - return imgs[0] + for i := range imgs { + if imgs[i].ID == unitTestImageId { + return imgs[i] + } + } + panic(fmt.Errorf("Test image %v not found", unitTestImageId)) } func TestRuntimeCreate(t *testing.T) {