code: def test_inherit_healthcheck(serve_instance):
      class Parent:
          def __init__(self):
              self.should_fail = False
  
          def check_health(self):
              if self.should_fail:
                  raise Exception("intended to fail")
  
          def set_should_fail(self):
              self.should_fail = True
  
      @serve.deployment(health_check_period_s=1)
      class Child(Parent):
          def __call__(self, *args):
              return ray.get_runtime_context().current_actor
  
      h = serve.run(Child.bind())
      actors = {h.remote().result()._actor_id for _ in range(100)}
      assert len(actors) == 1
  
      h.set_should_fail.remote().result()
      wait_for_condition(
          check_new_actor_started, handle=h, original_actors=actors
      )
  
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 6 for calling a global function with example usage: test_inherit_healthcheck(serve_instance) and returns: ray