code: def test_health_check_failure_makes_deployment_unhealthy(
      serve_instance,
  ):
      """If a deployment always fails health check, the deployment should be unhealthy."""
  
      @serve.deployment
      class AlwaysUnhealthy:
          def check_health(self):
              raise Exception("intended to fail")
  
          def __call__(self, *args):
              return ray.get_runtime_context().current_actor
  
      with pytest.raises(RuntimeError):
          serve.run(AlwaysUnhealthy.bind())
  
      app_status = serve.status().applications[SERVE_DEFAULT_APP_NAME]
      assert (
          app_status.deployments["AlwaysUnhealthy"].status
          == DeploymentStatus.UNHEALTHY
      )
  
imports: import pytest
  import ray
  from ray import serve
  from ray._private.test_utils import wait_for_condition
  from ray.exceptions import RayError
  from ray.serve._private.common import DeploymentStatus
  from ray.serve._private.constants import REPLICA_HEALTH_CHECK_UNHEALTHY_THRESHOLD, SERVE_DEFAULT_APP_NAME
label_desc: Use image node_id 9 for calling a global function with example usage: test_health_check_failure_makes_deployment_unhealthy(serve_instance) and returns: ray