code: def test_worker_paused_async_actor(shutdown_only, actor_concurrency):
      ray.init(_system_config=_SYSTEM_CONFIG)
  
      @ray.remote
      class AsyncActor:
          async def main_task(self):
              import time
  
              # Pause 5 seconds inside debugger
              with ray._private.worker.global_worker.worker_paused_by_debugger():
                  time.sleep(5)
  
      def verify(num_paused):
          workers = list_workers(
              filters=[("num_paused_threads", "=", num_paused)],
              detail=True,
          )
          if len(workers) == 0:
              return False
          worker = workers[0]
          return worker.num_paused_threads == num_paused
  
      async_actor = AsyncActor.options(
          max_concurrency=actor_concurrency
      ).remote()
      refs = [async_actor.main_task.remote() for i in range(20)]  # noqa
  
      # This actor runs on a single thread, so num_paused should be 1
      wait_for_condition(verify, num_paused=1)
  
file_path: ray/python/ray/tests/test_worker_state.py
imports: import os
  import pytest
  import sys
  import threading
  import ray
  from ray._private.test_utils import wait_for_condition
  from ray.util.state import list_workers
label_desc: Use image node_id 4 for calling a global function with example usage: test_worker_paused_async_actor(shutdown_only, actor_concurrency) and returns: unknown, False