MCPcopy
hub / github.com/grpc/grpc-go / retryUntil

Function retryUntil

authz/grpc_authz_end2end_test.go:548–557  ·  view source on GitHub ↗
(ctx context.Context, tsc testgrpc.TestServiceClient, want *status.Status)

Source from the content-addressed store, hash-verified

546}
547
548func retryUntil(ctx context.Context, tsc testgrpc.TestServiceClient, want *status.Status) (lastErr error) {
549 for ctx.Err() == nil {
550 _, lastErr = tsc.UnaryCall(ctx, &testpb.SimpleRequest{})
551 if s := status.Convert(lastErr); s.Code() == want.Code() && s.Message() == want.Message() {
552 return nil
553 }
554 time.Sleep(20 * time.Millisecond)
555 }
556 return lastErr
557}
558
559func (s) TestFileWatcher_ValidPolicyRefresh(t *testing.T) {
560 valid1 := authzTests["DeniesRPCMatchInDenyAndAllow"]

Calls 5

ConvertFunction · 0.92
ErrMethod · 0.80
CodeMethod · 0.80
MessageMethod · 0.80
UnaryCallMethod · 0.65

Tested by

no test coverage detected