code: def test_proxy_state_update_starting_ready_failed_once():
      """Test calling update method on ProxyState when the proxy state is STARTING and
      when the ready call failed once and succeeded for the following call.
  
      The proxy state started with STARTING status. After update is called for the first
      time and read call is blocked, the status is not changed to UNHEALTHY immediately
      and should stay as STARTING. The following ready call is unblocked and succeed. The
      status will then change to HEALTHY.
      """
      proxy_state = _create_proxy_state()
  
      # Ensure the proxy status before update is STARTING.
      assert proxy_state.status == ProxyStatus.STARTING
  
      # When the proxy ready call is blocked, the proxy wrapper call
      # status will be PENDING.
      proxy_state._actor_proxy_wrapper.ready = (
          ProxyWrapperCallStatus.PENDING
      )
  
      # Trigger update. The status do not change even when ready call is blocked.
      wait_for_condition(
          condition_predictor=_update_and_check_proxy_status,
          state=proxy_state,
          status=ProxyStatus.STARTING,
      )
  
      # Unblock ready call, trigger update, and wait for status change to HEALTHY.
      proxy_state._actor_proxy_wrapper.ready = (
          ProxyWrapperCallStatus.FINISHED_SUCCEED
      )
      wait_for_condition(
          condition_predictor=_update_and_check_proxy_status,
          state=proxy_state,
          status=ProxyStatus.HEALTHY,
      )
  
imports: import json
  import time
  from typing import List, Tuple
  from unittest.mock import patch
  import pytest
  from ray._private.test_utils import wait_for_condition
  from ray.serve._private.cluster_node_info_cache import ClusterNodeInfoCache
  from ray.serve._private.common import ProxyStatus
  from ray.serve._private.constants import PROXY_HEALTH_CHECK_UNHEALTHY_THRESHOLD
  from ray.serve._private.proxy_state import ProxyState, ProxyStateManager, ProxyWrapper, ProxyWrapperCallStatus
  from ray.serve._private.test_utils import MockTimer
  from ray.serve._private.utils import Timer
  from ray.serve.config import DeploymentMode, HTTPOptions
  from ray.serve.schema import LoggingConfig
label_desc: Use image node_id 11 for calling a global function with example usage: test_proxy_state_update_starting_ready_failed_once() without return types