code: def test_http_proxy_calllback_failures(ray_instance, capsys):
      """Test http proxy keeps restarting when callback function fails"""
  
      try:
          serve.start()
      except RayActorError:
          # serve.start will fail because the http proxy is not started successfully
          # and client use proxy handle to check the proxy readiness, so it will raise
          # RayActorError.
          pass
  
      client = _get_global_client()
  
      def check_http_proxy_keep_restarting():
          # The proxy will be under "STARTING" status and keep restarting.
          prev_actor_id = None
          while True:
              serve_details = ServeInstanceDetails(
                  **client.get_serve_details()
              )
              for _, proxy_info in serve_details.proxies.items():
                  if proxy_info.status != ProxyStatus.STARTING:
                      return False
                  if prev_actor_id is None:
                      prev_actor_id = proxy_info.actor_id
                      break
                  elif prev_actor_id != proxy_info.actor_id:
                      return True
  
      wait_for_condition(check_http_proxy_keep_restarting)
  
imports: import importlib
  import logging
  import os
  import sys
  import pytest
  import requests
  import starlette
  from starlette.middleware import Middleware
  import ray
  from ray import serve
  from ray._private.test_utils import wait_for_condition
  from ray.exceptions import RayActorError
  from ray.serve._private.common import ProxyStatus
  from ray.serve._private.utils import call_function_from_import_path
  from ray.serve.context import _get_global_client
  from ray.serve.schema import LoggingConfig, ServeInstanceDetails
label_desc: Use image node_id 10 for calling a global function with example usage: test_http_proxy_calllback_failures(ray_instance, capsys) and returns: False, True