Fix tests

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
Kazuyoshi Kato
2022-04-21 17:36:37 +00:00
parent aefd1849b6
commit 7a4f81d8ba
6 changed files with 127 additions and 49 deletions

View File

@@ -19,7 +19,6 @@ package exchange
import (
"context"
"errors"
"reflect"
"testing"
"time"
@@ -27,7 +26,9 @@ import (
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/events"
"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/protobuf"
"github.com/containerd/typeurl"
"github.com/google/go-cmp/cmp"
)
func TestExchangeBasic(t *testing.T) {
@@ -102,7 +103,7 @@ func TestExchangeBasic(t *testing.T) {
break subscribercheck
}
if reflect.DeepEqual(received, testevents) {
if cmp.Equal(received, testevents, protobuf.Compare) {
// when we do this, we expect the errs channel to be closed and
// this will return.
subscriber.cancel()
@@ -260,7 +261,7 @@ func TestExchangeFilters(t *testing.T) {
break subscribercheck
}
if reflect.DeepEqual(received, subscriber.expectEvents) {
if cmp.Equal(received, subscriber.expectEvents, protobuf.Compare) {
// when we do this, we expect the errs channel to be closed and
// this will return.
subscriber.cancel()