From 3fa17cc18fc052842a32d75109cd8ae1035e39d7 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Wed, 9 Aug 2023 14:40:15 -0700 Subject: [PATCH] test: speed up test that was taking 10 seconds to timeout (#6531) --- test/creds_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/creds_test.go b/test/creds_test.go index 06c716a3ee92..28e16eb543fc 100644 --- a/test/creds_test.go +++ b/test/creds_test.go @@ -270,10 +270,11 @@ func (s) TestWaitForReadyRPCErrorOnBadCertificates(t *testing.T) { defer cc.Close() tc := testgrpc.NewTestServiceClient(cc) - if _, err = tc.EmptyCall(ctx, &testpb.Empty{}, grpc.WaitForReady(true)); strings.Contains(err.Error(), clientAlwaysFailCredErrorMsg) { - return + ctx, cancel = context.WithTimeout(context.Background(), defaultTestShortTimeout) + defer cancel() + if _, err = tc.EmptyCall(ctx, &testpb.Empty{}, grpc.WaitForReady(true)); !strings.Contains(err.Error(), clientAlwaysFailCredErrorMsg) { + t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want err.Error() contains %q", err, clientAlwaysFailCredErrorMsg) } - te.t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want err.Error() contains %q", err, clientAlwaysFailCredErrorMsg) } var (