Skip to content

Commit 0847688

Browse files
committedAug 5, 2019
backport etcd-io#9860 watch_test.go
Signed-off-by: Sam Batschelet <[email protected]>
1 parent 0840ffa commit 0847688

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
 

‎clientv3/integration/watch_test.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
mvccpb "github.com/coreos/etcd/mvcc/mvccpb"
3131
"github.com/coreos/etcd/pkg/testutil"
3232

33-
"google.golang.org/grpc"
3433
"google.golang.org/grpc/metadata"
3534
)
3635

@@ -667,8 +666,8 @@ func TestWatchErrConnClosed(t *testing.T) {
667666
go func() {
668667
defer close(donec)
669668
ch := cli.Watch(context.TODO(), "foo")
670-
if wr := <-ch; grpc.ErrorDesc(wr.Err()) != grpc.ErrClientConnClosing.Error() {
671-
t.Fatalf("expected %v, got %v", grpc.ErrClientConnClosing, grpc.ErrorDesc(wr.Err()))
669+
if wr := <-ch; !isCanceled(wr.Err()) {
670+
t.Fatalf("expected context canceled, got %v", wr.Err())
672671
}
673672
}()
674673

@@ -699,8 +698,8 @@ func TestWatchAfterClose(t *testing.T) {
699698
donec := make(chan struct{})
700699
go func() {
701700
cli.Watch(context.TODO(), "foo")
702-
if err := cli.Close(); err != nil && err != grpc.ErrClientConnClosing {
703-
t.Fatalf("expected %v, got %v", grpc.ErrClientConnClosing, err)
701+
if err := cli.Close(); err != nil && err != context.Canceled {
702+
t.Fatalf("expected %v, got %v", context.Canceled, err)
704703
}
705704
close(donec)
706705
}()

0 commit comments

Comments
 (0)