@@ -138,7 +138,7 @@ func (s) TestServeLDSRDS(t *testing.T) {
138138// waitForFailedRPCWithStatusCode makes Unary RPC's until it receives the
139139// expected status in a polling manner. Fails if the RPC made does not return
140140// the expected status before the context expires.
141- func waitForFailedRPCWithStatusCode (ctx context.Context , t * testing.T , cc * grpc.ClientConn , st ... * status.Status ) {
141+ func waitForFailedRPCWithStatusCode (ctx context.Context , t * testing.T , cc * grpc.ClientConn , sts ... * status.Status ) {
142142 t .Helper ()
143143
144144 c := testgrpc .NewTestServiceClient (cc )
@@ -150,9 +150,12 @@ func waitForFailedRPCWithStatusCode(ctx context.Context, t *testing.T, cc *grpc.
150150 case <- ctx .Done ():
151151 t .Fatalf ("failure when waiting for RPCs to fail with certain status %v: %v. most recent error received from RPC: %v" , st , ctx .Err (), err .Error ())
152152 case <- ticker .C :
153- if _ , err = c .EmptyCall (ctx , & testpb.Empty {}); status .Code (err ) == st .Code () && strings .Contains (err .Error (), st .Message ()) {
154- t .Logf ("most recent error happy case: %v" , err .Error ())
155- return
153+ _ , err = c .EmptyCall (ctx , & testpb.Empty {})
154+ for _ , st := range sts {
155+ if status .Code (err ) == st .Code () && strings .Contains (err .Error (), st .Message ()) {
156+ t .Logf ("most recent error happy case: %v" , err .Error ())
157+ return
158+ }
156159 }
157160 }
158161 }
0 commit comments