code: def test_single_app_shutdown_actors(ray_shutdown):
      """Tests serve.shutdown() works correctly in single-app case
  
      Ensures that after deploying a (nameless) app using serve.run(), serve.shutdown()
      deletes all actors (controller, http proxy, all replicas) in the "serve" namespace.
      """
      ray.init(num_cpus=16)
      serve.start(http_options=dict(port=8003))
  
      @serve.deployment
      def f():
          pass
  
      serve.run(f.bind(), name="app")
  
      actor_names = {
          "ServeController",
          "ProxyActor",
          "ServeReplica:app:f",
      }
  
      def check_alive():
          actors = list_actors(
              filters=[
                  ("ray_namespace", "=", SERVE_NAMESPACE),
                  ("state", "=", "ALIVE"),
              ]
          )
          return {
              actor["class_name"] for actor in actors
          } == actor_names
  
      def check_dead():
          actors = list_actors(
              filters=[
                  ("ray_namespace", "=", SERVE_NAMESPACE),
                  ("state", "=", "ALIVE"),
              ]
          )
          return len(actors) == 0
  
      wait_for_condition(check_alive)
      serve.shutdown()
      wait_for_condition(check_dead)
  
imports: import logging
  import os
  import socket
  import sys
  import time
  import pytest
  import requests
  import ray
  import ray._private.gcs_utils
  from ray import serve
  from ray._private.services import new_port
  from ray._private.test_utils import convert_actor_state, run_string_as_driver, wait_for_condition
  from ray._raylet import GcsClient
  from ray.cluster_utils import Cluster, cluster_not_supported
  from ray.serve._private import api
  from ray.serve._private.constants import SERVE_CONTROLLER_NAME, SERVE_DEFAULT_APP_NAME, SERVE_NAMESPACE, SERVE_PROXY_NAME, SERVE_ROOT_URL_ENV_KEY
  from ray.serve._private.default_impl import create_cluster_node_info_cache
  from ray.serve._private.http_util import set_socket_reuse_port
  from ray.serve._private.utils import block_until_http_ready, format_actor_name
  from ray.serve.config import DeploymentMode, HTTPOptions, ProxyLocation
  from ray.serve.context import _get_global_client
  from ray.serve.exceptions import RayServeException
  from ray.serve.schema import ServeApplicationSchema, ServeDeploySchema
  from ray.tests.conftest import maybe_external_redis
  from ray.tests.conftest import ray_start_with_dashboard
  from ray.util.state import list_actors
label_desc: Use image node_id 4 for calling a global function with example usage: test_single_app_shutdown_actors(ray_shutdown) and returns: unknown, unknown