class_docstr: Helper for testing gRPC client logic with a dummy gRPC server.
class_docstr_tok: ["Helper","for","testing","gRPC","client","logic","with","a","dummy","gRPC","server","."]
docstr: Context manager to run the gRPC server and yield a client for it.
docstr_tok: ["Context","manager","to","run","the","gRPC","server","and","yield","a","client","for","it","."]
code: def run(self):
      """Context manager to run the gRPC server and yield a client for it."""
      server = grpc.server(futures.ThreadPoolExecutor(max_workers=1))
      grpc_util_test_pb2_grpc.add_TestServiceServicer_to_server(
          self, server
      )
      port = server.add_secure_port(
          "localhost:0", grpc.local_server_credentials()
      )
  
      def launch_server():
          server.start()
          server.wait_for_termination()
  
      thread = threading.Thread(
          target=launch_server, name="TestGrpcServer"
      )
      thread.daemon = True
      thread.start()
      with grpc.secure_channel(
          "localhost:%d" % port, grpc.local_channel_credentials()
      ) as channel:
          yield grpc_util_test_pb2_grpc.TestServiceStub(channel)
      server.stop(grace=None)
      thread.join()
  
imports: import contextlib
  import hashlib
  import threading
  import time
  from concurrent import futures
  import grpc
  from tensorboard.util import grpc_util
  from tensorboard.util import grpc_util_test_pb2
  from tensorboard.util import grpc_util_test_pb2_grpc
  from tensorboard.util import test_util
  from tensorboard import test
  from tensorboard import version
label_desc: Use image node_id 3 for calling the TestGrpcServer obj's underlying member method code with example usage: obj.run() without return types