code: def test_actor_task_fast_fail(ray_start_cluster):
      # Explicitly set `max_task_retries=0` here to show the test scenario.
      @ray.remote(max_restarts=1, max_task_retries=0)
      class SlowActor:
          def __init__(self, signal_actor):
              if (
                  ray.get_runtime_context().was_current_actor_reconstructed
              ):
                  ray.get(signal_actor.wait.remote())
  
          def ping(self):
              return "pong"
  
      signal = SignalActor.remote()
      actor = SlowActor.remote(signal)
      ray.get(actor.ping.remote())
      ray.kill(actor, no_restart=False)
  
      # Wait for a while so that now the driver knows the actor is in
      # RESTARTING state.
      time.sleep(1)
      # An actor task should fail quickly until the actor is restarted if
      # `max_task_retries` is 0.
      with pytest.raises(ray.exceptions.RayActorError):
          ray.get(actor.ping.remote())
  
      signal.send.remote()
      # Wait for a while so that now the driver knows the actor is in
      # ALIVE state.
      time.sleep(1)
      # An actor task should succeed.
      ray.get(actor.ping.remote())
  
imports: import subprocess
  import sys
  import time
  import grpc
  import numpy
  import psutil
  import pytest
  from grpc._channel import _InactiveRpcError
  from ray.util.state import list_tasks
  from ray._private.state_api_test_utils import verify_failed_task
  import ray
  import ray._private.ray_constants
  import ray.experimental.internal_kv
  from ray import NodeID
  from ray._private.test_utils import SignalActor, get_error_message, init_error_pubsub, run_string_as_driver, wait_for_condition, kill_raylet
  from ray.cluster_utils import Cluster, cluster_not_supported
  from ray.core.generated import gcs_service_pb2, gcs_service_pb2_grpc, node_manager_pb2, node_manager_pb2_grpc
  from ray.exceptions import LocalRayletDiedError
label_desc: Use image node_id 13 for calling a global function with example usage: test_actor_task_fast_fail(ray_start_cluster) and returns: str