Browse code

Fix a race condition in the integration tests

Solomon Hykes authored on 2013/11/26 13:54:34
Showing 1 changed files
... ...
@@ -71,9 +71,8 @@ func TestInterruptedRegister(t *testing.T) {
71 71
 		Comment: "testing",
72 72
 		Created: time.Now(),
73 73
 	}
74
-	go graph.Register(nil, badArchive, image)
75
-	time.Sleep(200 * time.Millisecond)
76 74
 	w.CloseWithError(errors.New("But I'm not a tarball!")) // (Nobody's perfect, darling)
75
+	graph.Register(nil, badArchive, image)
77 76
 	if _, err := graph.Get(image.ID); err == nil {
78 77
 		t.Fatal("Image should not exist after Register is interrupted")
79 78
 	}