@@ -6716,6 +6716,29 @@ func (s) TestFailFastRPCErrorOnBadCertificates(t *testing.T) {
6716
6716
te .t .Fatalf ("TestService/EmptyCall(_, _) = _, %v, want err.Error() contains %q" , err , clientAlwaysFailCredErrorMsg )
6717
6717
}
6718
6718
6719
+ func (s ) TestWaitForReadyRPCErrorOnBadCertificates (t * testing.T ) {
6720
+ te := newTest (t , env {name : "bad-cred" , network : "tcp" , security : "clientAlwaysFailCred" , balancer : "round_robin" })
6721
+ te .startServer (& testServer {security : te .e .security })
6722
+ defer te .tearDown ()
6723
+
6724
+ opts := []grpc.DialOption {grpc .WithTransportCredentials (clientAlwaysFailCred {})}
6725
+ dctx , dcancel := context .WithTimeout (context .Background (), 10 * time .Second )
6726
+ defer dcancel ()
6727
+ cc , err := grpc .DialContext (dctx , te .srvAddr , opts ... )
6728
+ if err != nil {
6729
+ t .Fatalf ("Dial(_) = %v, want %v" , err , nil )
6730
+ }
6731
+ defer cc .Close ()
6732
+
6733
+ tc := testpb .NewTestServiceClient (cc )
6734
+ ctx , cancel := context .WithTimeout (context .Background (), 1 * time .Second )
6735
+ defer cancel ()
6736
+ if _ , err = tc .EmptyCall (ctx , & testpb.Empty {}, grpc .WaitForReady (true )); strings .Contains (err .Error (), clientAlwaysFailCredErrorMsg ) {
6737
+ return
6738
+ }
6739
+ te .t .Fatalf ("TestService/EmptyCall(_, _) = _, %v, want err.Error() contains %q" , err , clientAlwaysFailCredErrorMsg )
6740
+ }
6741
+
6719
6742
func (s ) TestRPCTimeout (t * testing.T ) {
6720
6743
for _ , e := range listTestEnv () {
6721
6744
testRPCTimeout (t , e )
0 commit comments