code: def test_ray_stop_kill_workers():
      check_call_ray(["start", "--head"])
  
      ray.init(address="auto")
  
      @ray.remote
      class Actor:
          async def ping(self):
              return os.getpid()
  
          async def run_forever(self):
              while True:
                  await asyncio.sleep(5)
  
      actor = Actor.options(lifetime="detached", name="A").remote()
      actor.run_forever.remote()
      actor_pid = ray.get(actor.ping.remote())
      ray.shutdown()
  
      check_call_ray(["stop", "--force"])
  
      assert not psutil.pid_exists(actor_pid)
  
imports: import asyncio
  import os
  import subprocess
  import sys
  from pathlib import Path
  import psutil
  import pytest
  import ray
  import ray._private.ray_constants
  from ray._private.test_utils import Semaphore, check_call_ray, check_call_subprocess, kill_process_by_name, start_redis_instance, run_string_as_driver, run_string_as_driver_nonblocking, wait_for_children_of_pid, wait_for_children_of_pid_to_exit
  from ray._private.utils import detect_fate_sharing_support
label_desc: Use image node_id 10 for calling a global function with example usage: test_ray_stop_kill_workers() and returns: os