code: def test_nested(config, ray_start_cluster, reconstruction_enabled):
      config["fetch_fail_timeout_milliseconds"] = 10_000
      # Workaround to reset the config to the default value.
      if not reconstruction_enabled:
          config["lineage_pinning_enabled"] = False
  
      cluster = ray_start_cluster
      # Head node with no resources.
      cluster.add_node(
          num_cpus=0,
          _system_config=config,
          enable_object_reconstruction=reconstruction_enabled,
      )
      ray.init(address=cluster.address)
      done_signal = SignalActor.remote()
      exit_signal = SignalActor.remote()
      ray.get(done_signal.wait.remote(should_wait=False))
      ray.get(exit_signal.wait.remote(should_wait=False))
  
      # Node to place the initial object.
      node_to_kill = cluster.add_node(
          num_cpus=1, object_store_memory=10**8
      )
      cluster.wait_for_nodes()
  
      @ray.remote
      def dependent_task(x):
          return
  
      @ray.remote
      def large_object():
          return np.zeros(10**7, dtype=np.uint8)
  
      @ray.remote
      def nested(done_signal, exit_signal):
          ref = ray.put(np.zeros(10**7, dtype=np.uint8))
          # Flush object store.
          for _ in range(20):
              ray.put(np.zeros(10**7, dtype=np.uint8))
          dep = dependent_task.options(resources={"node": 1}).remote(
              ref
          )
          ray.get(done_signal.send.remote(clear=True))
          ray.get(dep)
          return ray.get(ref)
  
      ref = nested.remote(done_signal, exit_signal)
      # Wait for task to get scheduled on the node to kill.
      ray.get(done_signal.wait.remote())
      # Wait for ray.put object to get transferred to the other node.
      cluster.add_node(
          num_cpus=2,
          resources={"node": 10},
          object_store_memory=10**8,
      )
      ray.get(dependent_task.remote(ref))
  
      # Destroy the task's output.
      cluster.remove_node(node_to_kill, allow_graceful=False)
      wait_for_condition(
          lambda: not all(node["Alive"] for node in ray.nodes()),
          timeout=10,
      )
  
      if reconstruction_enabled:
          ray.get(ref, timeout=60)
      else:
          with pytest.raises(ray.exceptions.ObjectLostError):
              ray.get(ref, timeout=60)
  
file_path: ray/python/ray/tests/test_reconstruction_2.py
imports: import os
  import sys
  import time
  import numpy
  import pytest
  import ray
  import ray._private.ray_constants
  from ray._private.internal_api import memory_summary
  from ray._private.test_utils import Semaphore, SignalActor, wait_for_condition
label_desc: Use image node_id 6 for calling a global function with example usage: test_nested(config, ray_start_cluster, reconstruction_enabled) and returns: np, ray