code: def test_serve_shut_down_without_duplicated_logs(
      shutdown_ray, call_ray_stop_only  # noqa: F811
  ):
      """Test Serve shut down without duplicated logs.
  
      When Serve shutdown is called and executing the shutdown process, the controller
      log should not be spamming controller shutdown and deleting app messages.
      """
      cluster = Cluster()
      cluster.add_node()
      cluster.wait_for_nodes()
      ray.init(address=cluster.address)
  
      @serve.deployment
      class HelloModel:
          def __call__(self):
              return "hello"
  
      model = HelloModel.bind()
      serve.run(target=model)
      serve.shutdown()
  
      # Ensure the all resources are shutdown gracefully.
      wait_for_condition(
          lambda: all(
              [
                  actor["State"] == "DEAD"
                  for actor in ray._private.state.actors().values()
              ]
          ),
      )
  
      all_serve_logs = ""
      for filename in os.listdir(get_serve_logs_dir()):
          with open(
              os.path.join(get_serve_logs_dir(), filename), "r"
          ) as f:
              all_serve_logs += f.read()
      assert all_serve_logs.count("Controller shutdown started") == 1
      assert all_serve_logs.count("Deleting application 'default'") == 1
  
imports: import os
  import subprocess
  import sys
  from contextlib import contextmanager
  from tempfile import NamedTemporaryFile
  import pytest
  import requests
  import ray
  import ray._private.state
  import ray.actor
  from ray import serve
  from ray._private.test_utils import SignalActor, wait_for_condition
  from ray.cluster_utils import AutoscalingCluster, Cluster
  from ray.exceptions import RayActorError
  from ray.serve._private.common import ProxyStatus
  from ray.serve._private.constants import SERVE_DEFAULT_APP_NAME
  from ray.serve._private.logging_utils import get_serve_logs_dir
  from ray.serve._private.utils import get_head_node_id
  from ray.serve.context import _get_global_client
  from ray.serve.schema import ServeInstanceDetails
  from ray.tests.conftest import call_ray_stop_only
label_desc: Use image node_id 13 for calling a global function with example usage: test_serve_shut_down_without_duplicated_logs(shutdown_ray, call_ray_stop_only) and returns: str