code: def test_driver_dead(short_gcs_publish_timeout, shutdown_only):
      """Make sure all ray workers are shutdown when driver is killed."""
      driver = """
  import ray
  ray.init(_system_config={"gcs_rpc_server_reconnect_timeout_s": 1})
  @ray.remote
  def f():
      import time
      time.sleep(10)
  
  num_cpus = int(ray.available_resources()["CPU"])
  tasks = [f.remote() for _ in range(num_cpus)]
  """
  
      p = run_string_as_driver_nonblocking(driver)
      # Make sure the driver is running.
      time.sleep(1)
      assert p.poll() is None
      wait_for_condition(
          lambda: len(get_all_ray_worker_processes()) > 0
      )
  
      # Kill the driver process.
      p.kill()
      p.wait()
      time.sleep(0.1)
  
      wait_for_condition(
          lambda: len(get_all_ray_worker_processes()) == 0,
          timeout=WAIT_TIMEOUT,
      )
  
imports: import sys
  import time
  import platform
  import os
  import signal
  import multiprocessing
  import pytest
  import ray
  import psutil
  from ray._private.test_utils import wait_for_condition, run_string_as_driver_nonblocking
  from ray.util.state import get_worker, list_tasks
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
label_desc: Use image node_id 8 for calling a global function with example usage: test_driver_dead(short_gcs_publish_timeout, shutdown_only) without return types