code: def test_actor_creation_task_failed(shutdown_only):
      ray.init(_system_config=_SYSTEM_CONFIG)
      a = ActorInitFailed.remote()
  
      with pytest.raises(ray.exceptions.RayActorError):
          ray.get(a.ready.remote())
  
      def verify():
          tasks = list_tasks(
              filters=[("name", "=", "ActorInitFailed.__init__")]
          )
          actors = list_actors(
              filters=[("class_name", "=", "ActorInitFailed")]
          )
  
          assert len(tasks) == 1
          assert len(actors) == 1
          actor = actors[0]
          task = tasks[0]
          assert task["state"] == "FAILED"
          assert task["actor_id"] == actor["actor_id"]
          assert actor["state"] == "DEAD"
          return True
  
      wait_for_condition(verify)
  
imports: import asyncio
  from collections import defaultdict
  import os
  from typing import Dict
  import pytest
  import sys
  import time
  from ray._private import ray_constants
  from functools import reduce
  import ray
  from ray._private.state_api_test_utils import PidActor, get_state_api_manager, verify_tasks_running_or_terminated, verify_failed_task
  from ray.util.state.common import ListApiOptions, StateResource
  from ray._private.test_utils import async_wait_for_condition_async_predicate, run_string_as_driver, run_string_as_driver_nonblocking, wait_for_condition
  from ray.util.state import StateApiClient, list_actors, list_jobs, list_tasks
label_desc: Use image node_id 2 for calling a global function with example usage: test_actor_creation_task_failed(shutdown_only) and returns: True