code: def test_dying_worker_wait(ray_start_2_cpus):
      @ray.remote
      def sleep_forever():
          time.sleep(10**6)
  
      @ray.remote
      def get_pid():
          return os.getpid()
  
      x_id = sleep_forever.remote()
      # Get the PID of the worker that block_in_wait will run on (sleep a little
      # to make sure that sleep_forever has already started).
      time.sleep(0.1)
      worker_pid = ray.get(get_pid.remote())
  
      @ray.remote
      def block_in_wait(object_ref_in_list):
          ray.wait(object_ref_in_list)
  
      # Have the worker wait in a wait call.
      block_in_wait.remote([x_id])
      time.sleep(0.1)
  
      # Kill the worker.
      os.kill(worker_pid, SIGKILL)
      time.sleep(0.1)
  
      # Create the object.
      obj = np.ones(200 * 1024, dtype=np.uint8)
      ray._private.worker.global_worker.put_object(obj, x_id)
      time.sleep(0.1)
  
      # Make sure that nothing has died.
      assert ray._private.services.remaining_processes_alive()
  
file_path: ray/python/ray/tests/test_component_failures.py
imports: import os
  import signal
  import sys
  import time
  import numpy
  import pytest
  import ray
  from ray._private.test_utils import SignalActor, run_string_as_driver_nonblocking
label_desc: Use image node_id 3 for calling a global function with example usage: test_dying_worker_wait(ray_start_2_cpus) and returns: os