code: def test_warning_many_actor_tasks_queued(shutdown_only, sync: bool):
      ray.init(num_cpus=1)
      p = init_error_pubsub()
  
      @ray.remote(num_cpus=1)
      class SyncFoo:
          def f(self):
              import time
  
              time.sleep(1)
  
      @ray.remote(num_cpus=1)
      class AsyncFoo:
          async def f(self):
              import asyncio
  
              await asyncio.sleep(1)
  
      Foo = SyncFoo if sync else AsyncFoo
      a = Foo.remote()
      [a.f.remote() for _ in range(50000)]
      errors = get_error_message(
          p, 4, ray_constants.EXCESS_QUEUEING_WARNING
      )
      msgs = [e["error_message"] for e in errors]
      assert (
          "Warning: More than 5000 tasks are pending submission to actor"
          in msgs[0]
      )
      assert (
          "Warning: More than 10000 tasks are pending submission to actor"
          in msgs[1]
      )
      assert (
          "Warning: More than 20000 tasks are pending submission to actor"
          in msgs[2]
      )
      assert (
          "Warning: More than 40000 tasks are pending submission to actor"
          in msgs[3]
      )
  
imports: import os
  import signal
  import sys
  import time
  import numpy
  import pytest
  import ray
  import ray._private.gcs_utils
  import ray._private.ray_constants
  import ray._private.utils
  from ray._private.test_utils import SignalActor, convert_actor_state, get_error_message, init_error_pubsub, wait_for_condition
  from ray.exceptions import GetTimeoutError, RayActorError, RayTaskError
label_desc: Use image node_id 18 for calling a global function with example usage: test_warning_many_actor_tasks_queued(shutdown_only, sync) without return types