pkg/storage/etcd3: use correct diff in tests

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
This commit is contained in:
Steve Kuznetsov 2022-03-23 12:33:57 -08:00
parent 75b19b242c
commit 8903372e8b
No known key found for this signature in database
GPG Key ID: 8821C29EC988D9B4

View File

@ -23,7 +23,6 @@ import (
"testing" "testing"
"time" "time"
"github.com/google/go-cmp/cmp"
clientv3 "go.etcd.io/etcd/client/v3" clientv3 "go.etcd.io/etcd/client/v3"
"k8s.io/apimachinery/pkg/api/apitesting" "k8s.io/apimachinery/pkg/api/apitesting"
@ -390,9 +389,7 @@ func testCheckResult(t *testing.T, expectEventType watch.EventType, w watch.Inte
t.Errorf("event type want=%v, get=%v", expectEventType, res.Type) t.Errorf("event type want=%v, get=%v", expectEventType, res.Type)
return return
} }
if diff := cmp.Diff(expectObj, res.Object); diff != "" { expectNoDiff(t, "incorrect obj", expectObj, res.Object)
t.Errorf("incorrect obj: %s", diff)
}
case <-time.After(wait.ForeverTestTimeout): case <-time.After(wait.ForeverTestTimeout):
t.Errorf("time out after waiting %v on ResultChan", wait.ForeverTestTimeout) t.Errorf("time out after waiting %v on ResultChan", wait.ForeverTestTimeout)
} }