Fix a race condition in the integration tests

Upstream-commit: 23022932440006aca0a954763bf8e3a5882f94d3
Component: engine
This commit is contained in:
Solomon Hykes
2013-11-26 04:54:34 +00:00
parent caee8ff1ca
commit 8a3d9c6cf3

View File

@ -71,9 +71,8 @@ func TestInterruptedRegister(t *testing.T) {
Comment: "testing",
Created: time.Now(),
}
go graph.Register(nil, badArchive, image)
time.Sleep(200 * time.Millisecond)
w.CloseWithError(errors.New("But I'm not a tarball!")) // (Nobody's perfect, darling)
graph.Register(nil, badArchive, image)
if _, err := graph.Get(image.ID); err == nil {
t.Fatal("Image should not exist after Register is interrupted")
}