code: def test_grpc_proxy_routing_without_metadata(ray_cluster):
      """Test metadata are not required when calling gRPC proxy with only one app.
  
      When there is only one app deployed, gRPC proxy will route the request to the app
      with or without the metadata. If there are multiple app deployed, without metadata
      will return a notfound response.
      """
      cluster = ray_cluster
      cluster.add_node(num_cpus=2)
      cluster.connect(namespace=SERVE_NAMESPACE)
  
      grpc_port = 9000
      grpc_servicer_functions = [
          "ray.serve.generated.serve_pb2_grpc.add_UserDefinedServiceServicer_to_server",
          "ray.serve.generated.serve_pb2_grpc.add_FruitServiceServicer_to_server",
      ]
  
      serve.start(
          grpc_options=gRPCOptions(
              port=grpc_port,
              grpc_servicer_functions=grpc_servicer_functions,
          ),
      )
  
      app1 = "app1"
      serve.run(target=g, name=app1, route_prefix=f"/{app1}")
  
      # Ensures the app is not yet deployed.
      deployment_name = "grpc-deployment"
      app1_replica_name = DeploymentID(deployment_name, app1)
      replicas = ray.get(
          serve.context._global_client._controller._all_running_replicas.remote()
      )
  
      # Ensures the app is deployed.
      assert len(replicas[app1_replica_name]) == 1
  
      channel = grpc.insecure_channel("localhost:9000")
      stub = serve_pb2_grpc.UserDefinedServiceStub(channel)
      request = serve_pb2.UserDefinedMessage(
          name="foo", num=30, foo="bar"
      )
  
      # Ensures the gRPC Proxy responding correctly without metadata.
      response, call = stub.__call__.with_call(request=request)
      assert call.code() == grpc.StatusCode.OK
      assert response.greeting == "Hello foo from bar"
  
      # Ensures the gRPC Proxy responding correctly with metadata.
      metadata = (("application", app1),)
      response, call = stub.__call__.with_call(
          request=request, metadata=metadata
      )
      assert call.code() == grpc.StatusCode.OK
      assert response.greeting == "Hello foo from bar"
  
      # Deploy another app.
      app2 = "app2"
      serve.run(target=g2, name=app2, route_prefix=f"/{app2}")
      replicas = ray.get(
          serve.context._global_client._controller._all_running_replicas.remote()
      )
      deployment_name = "grpc-deployment-model-composition"
  
      # Ensure both apps are deployed
      app2_replica_name = DeploymentID(deployment_name, app2)
      assert len(replicas[app1_replica_name]) == 1
      assert len(replicas[app2_replica_name]) == 1
  
      # Ensure the gRPC request without metadata will now return not found response.
      with pytest.raises(grpc.RpcError) as exception_info:
          _, _ = stub.__call__.with_call(request=request)
      rpc_error = exception_info.value
      assert rpc_error.code() == grpc.StatusCode.NOT_FOUND
      assert "Application metadata not set" in rpc_error.details()
  
imports: import os
  import sys
  from typing import Any
  import grpc
  import pytest
  import ray
  from ray import serve
  from ray._private.test_utils import SignalActor, wait_for_condition
  from ray.cluster_utils import Cluster
  from ray.serve._private.common import DeploymentID
  from ray.serve._private.constants import SERVE_NAMESPACE
  from ray.serve._private.test_utils import ping_fruit_stand, ping_grpc_another_method, ping_grpc_call_method, ping_grpc_healthz, ping_grpc_list_applications, ping_grpc_model_multiplexing, ping_grpc_streaming, send_signal_on_cancellation
  from ray.serve.config import gRPCOptions
  from ray.serve.generated import serve_pb2, serve_pb2_grpc
  from ray.serve.grpc_util import RayServegRPCContext
  from ray.serve.tests.test_config_files.grpc_deployment import g, g2
label_desc: Use image node_id 3 for calling a global function with example usage: test_grpc_proxy_routing_without_metadata(ray_cluster) without return types