Fail if want != have!

This commit is contained in:
Tom Wilkie
2015-08-26 15:41:31 +00:00
parent d9ab9d8150
commit 7c1ca152fa
2 changed files with 2 additions and 2 deletions

View File

@@ -192,7 +192,7 @@ func TestRegistryEvents(t *testing.T) {
runtime.Gosched()
check := func(want []docker.Container) {
test.Poll(t, 10*time.Millisecond, want, func() interface{} {
test.Poll(t, 100*time.Millisecond, want, func() interface{} {
return allContainers(registry)
})
}

View File

@@ -19,7 +19,7 @@ func Poll(t *testing.T, d time.Duration, want interface{}, have func() interface
time.Sleep(d / 10)
}
h := have()
if reflect.DeepEqual(want, h) {
if !reflect.DeepEqual(want, h) {
t.Fatal(Diff(want, h))
}
}