code: def test_actor_creation_nested_failure_from_actor(shutdown_only):
      ray.init(_system_config=_SYSTEM_CONFIG)
  
      @ray.remote
      class NestedActor:
          def ready(self):
              a = ActorInitFailed.remote()
              ray.get(a.ready.remote())
  
      a = NestedActor.remote()
  
      with pytest.raises(ray.exceptions.RayTaskError):
          ray.get(a.ready.remote())
  
      def verify():
          creation_tasks = list_tasks(
              filters=[("type", "=", "ACTOR_CREATION_TASK")]
          )
          actors = list_actors()
  
          assert len(creation_tasks) == 2
          assert len(actors) == 2
          for actor in actors:
              if "NestedActor" in actor["class_name"]:
                  assert actor["state"] == "ALIVE"
              else:
                  assert "ActorInitFailed" in actor["class_name"]
                  assert actor["state"] == "DEAD"
  
          for task in creation_tasks:
              if "ActorInitFailed" in task["name"]:
                  assert task["state"] == "FAILED"
              else:
                  assert task["name"] == "NestedActor.__init__"
                  assert task["state"] == "FINISHED"
          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 3 for calling a global function with example usage: test_actor_creation_nested_failure_from_actor(shutdown_only) and returns: True