code: def test_ray_client(ray_client_instance):
      ray.util.connect(
          ray_client_instance, namespace="default_test_namespace"
      )
  
      start = """
  import ray
  ray.util.connect("{}", namespace="default_test_namespace")
  
  from ray import serve
  
  serve.start()
  """.format(
          ray_client_instance
      )
      run_string_as_driver(start)
  
      deploy = """
  import ray
  ray.util.connect("{}", namespace="default_test_namespace")
  
  from ray import serve
  
  @serve.deployment
  def f(*args):
      return "hello"
  
  serve.run(f.bind(), name="test1", route_prefix="/hello")
  """.format(
          ray_client_instance
      )
      run_string_as_driver(deploy)
  
      assert "test1" in serve.status().applications
      assert requests.get("http://localhost:8000/hello").text == "hello"
  
      delete = """
  import ray
  ray.util.connect("{}", namespace="default_test_namespace")
  
  from ray import serve
  
  serve.delete("test1")
  """.format(
          ray_client_instance
      )
      run_string_as_driver(delete)
  
      assert "test1" not in serve.status().applications
  
      fastapi = """
  import ray
  ray.util.connect("{}", namespace="default_test_namespace")
  
  from ray import serve
  from fastapi import FastAPI
  
  app = FastAPI()
  
  @app.get("/")
  def hello():
      return "hello"
  
  @serve.deployment
  @serve.ingress(app)
  class A:
      pass
  
  serve.run(A.bind(), route_prefix="/A")
  """.format(
          ray_client_instance
      )
      run_string_as_driver(fastapi)
  
      assert requests.get("http://localhost:8000/A").json() == "hello"
  
      serve.shutdown()
      ray.util.disconnect()
  
file_path: ray/python/ray/serve/tests/test_ray_client.py
imports: import random
  import subprocess
  import sys
  import time
  import pytest
  import requests
  import ray
  from ray import serve
  from ray._private.test_utils import run_string_as_driver
label_desc: Use image node_id 3 for calling a global function with example usage: test_ray_client(ray_client_instance) without return types