code: def test_no_user_defined_method(serve_instance, use_class):
      """Check the default behavior when an actor crashes."""
  
      if use_class:
  
          @serve.deployment
          class A:
              def __call__(self, *args):
                  return ray.get_runtime_context().current_actor
  
      else:
  
          @serve.deployment
          def A(*args):
              return ray.get_runtime_context().current_actor
  
      h = serve.run(A.bind())
      actor = h.remote().result()
      ray.kill(actor)
  
      # This would time out if we wait for multiple health check failures.
      wait_for_condition(
          check_new_actor_started, handle=h, original_actors=actor
      )
  
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 2 for calling a global function with example usage: test_no_user_defined_method(serve_instance, use_class) and returns: ray, ray