code: def test_async_actor(shutdown_only):
      info = ray.init(num_cpus=3, _system_config=_SYSTEM_CONFIG)
  
      @ray.remote
      def sleep():
          time.sleep(999)
  
      @ray.remote(max_concurrency=30)
      class AsyncActor:
          async def sleep(self):
              await asyncio.sleep(300)
  
          async def do_get(self):
              await ray.get(sleep.remote())
  
      a = AsyncActor.remote()
      a.sleep.remote()
      expected = {
          "RUNNING_TASK": 1,
      }
      wait_for_condition(
          lambda: actors_by_state(info) == expected,
          timeout=20,
          retry_interval_ms=500,
      )
  
      # Test that this transitions the entire actor to reporting IN_RAY_GET state.
      a.do_get.remote()
      a.do_get.remote()
      expected = {
          "RUNNING_IN_RAY_GET": 1,
      }
      wait_for_condition(
          lambda: actors_by_state(info) == expected,
          timeout=20,
          retry_interval_ms=500,
      )
      del a
  
imports: import asyncio
  from collections import defaultdict
  import pytest
  import time
  from typing import Dict
  import ray
  from ray.util.state import list_actors
  from ray._private.test_utils import raw_metrics, wait_for_condition, run_string_as_driver
  from ray._private.worker import RayContext
label_desc: Use image node_id 7 for calling a global function with example usage: test_async_actor(shutdown_only) without return types