clientv3: Fix auth client to use endpoints instead of host when dialing, fix tests to block on dial when required.

This commit is contained in:
Joe Betz
2018-04-20 10:43:44 -07:00
committed by Gyuho Lee
parent 66e65cd660
commit f84f554301
6 changed files with 39 additions and 12 deletions

View File

@ -25,6 +25,7 @@ import (
"github.com/coreos/etcd/pkg/testutil"
"google.golang.org/grpc"
"google.golang.org/grpc/transport"
)
// TestV3MaintenanceDefragmentInflightRange ensures inflight range requests
@ -81,8 +82,9 @@ func TestV3KVInflightRangeRequests(t *testing.T) {
defer wg.Done()
_, err := kvc.Range(ctx, &pb.RangeRequest{Key: []byte("foo"), Serializable: true}, grpc.FailFast(false))
if err != nil {
if err != nil && rpctypes.ErrorDesc(err) != context.Canceled.Error() {
t.Fatalf("inflight request should be canceld with %v, got %v", context.Canceled, err)
errDesc := rpctypes.ErrorDesc(err)
if err != nil && !(errDesc == context.Canceled.Error() || errDesc == transport.ErrConnClosing.Desc) {
t.Fatalf("inflight request should be canceled with '%v' or '%v', got '%v'", context.Canceled.Error(), transport.ErrConnClosing.Desc, errDesc)
}
}
}()