Skip to content

Commit 3fa17cc

Browse files
authored
test: speed up test that was taking 10 seconds to timeout (#6531)
1 parent 694cb64 commit 3fa17cc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/creds_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,11 @@ func (s) TestWaitForReadyRPCErrorOnBadCertificates(t *testing.T) {
270270
defer cc.Close()
271271

272272
tc := testgrpc.NewTestServiceClient(cc)
273-
if _, err = tc.EmptyCall(ctx, &testpb.Empty{}, grpc.WaitForReady(true)); strings.Contains(err.Error(), clientAlwaysFailCredErrorMsg) {
274-
return
273+
ctx, cancel = context.WithTimeout(context.Background(), defaultTestShortTimeout)
274+
defer cancel()
275+
if _, err = tc.EmptyCall(ctx, &testpb.Empty{}, grpc.WaitForReady(true)); !strings.Contains(err.Error(), clientAlwaysFailCredErrorMsg) {
276+
t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want err.Error() contains %q", err, clientAlwaysFailCredErrorMsg)
275277
}
276-
te.t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want err.Error() contains %q", err, clientAlwaysFailCredErrorMsg)
277278
}
278279

279280
var (

0 commit comments

Comments
 (0)