code: def test_proxy_state_update_healthy_check_health_always_fails():
      """Test calling update method on ProxyState when the proxy state is HEALTHY and
      when the check_health call is always failing.
  
      The proxy state started with STARTING. After update is called and ready call
      succeeded, the status will change to HEALTHY. After the next few check_health called
      and failed, the status will eventually change to UNHEALTHY after all retries have
      exhausted.
      """
  
      proxy_state = _create_proxy_state()
      # When the proxy health call is failing, the proxy wrapper call
      # status will be FINISHED_FAILED.
      proxy_state._actor_proxy_wrapper.health = (
          ProxyWrapperCallStatus.FINISHED_FAILED
      )
  
      # Continuously trigger update. The status should change from STARTING to HEALTHY
      # when ready.
      wait_for_condition(
          condition_predictor=_update_and_check_proxy_status,
          state=proxy_state,
          status=ProxyStatus.HEALTHY,
      )
      first_check_time = proxy_state._last_health_check_time
  
      # Continuously trigger update and status should change from HEALTHY to UNHEALTHY.
      wait_for_condition(
          condition_predictor=_update_and_check_proxy_status,
          state=proxy_state,
          status=ProxyStatus.UNHEALTHY,
      )
  
      # Ensure the check time have changed since the last update
      assert first_check_time != proxy_state._last_health_check_time
  
      # Ensure _consecutive_health_check_failures is correct
      assert proxy_state._consecutive_health_check_failures == 3
  
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 16 for calling a global function with example usage: test_proxy_state_update_healthy_check_health_always_fails() without return types