code: def test_exit_actor_queued(shutdown_only):
      """Verify after exit_actor is called the queued tasks won't execute."""
  
      @ray.remote
      class RegressionSync:
          def f(self):
              import time
  
              time.sleep(1)
              exit_actor()
  
          def ping(self):
              pass
  
      @ray.remote
      class RegressionAsync:
          async def f(self):
              await asyncio.sleep(1)
              exit_actor()
  
          def ping(self):
              pass
  
      # Test async case.
      # https://github.com/ray-project/ray/issues/32376
      # If we didn't fix this issue, this will segfault.
      a = RegressionAsync.remote()
      a.f.remote()
      refs = [a.ping.remote() for _ in range(10000)]
      with pytest.raises(ray.exceptions.RayActorError) as exc_info:
          ray.get(refs)
      assert " Worker unexpectedly exits" not in str(exc_info.value)
  
      # Test a sync case.
      a = RegressionSync.remote()
      a.f.remote()
      with pytest.raises(ray.exceptions.RayActorError) as exc_info:
          ray.get([a.ping.remote() for _ in range(10000)])
      assert " Worker unexpectedly exits" not in str(exc_info.value)
  
imports: import atexit
  import asyncio
  import collections
  import numpy
  import os
  import pytest
  import signal
  import sys
  import time
  import ray
  from ray.actor import exit_actor
  import ray.cluster_utils
  from ray._private.test_utils import wait_for_condition, wait_for_pid_to_exit, generate_system_config_map, SignalActor
label_desc: Use image node_id 19 for calling a global function with example usage: test_exit_actor_queued(shutdown_only) without return types