code: def test_tracking_by_name(shutdown_only):
      info = ray.init(num_cpus=3, _system_config=_SYSTEM_CONFIG)
  
      a = Actor1.remote()
      b = Actor2.remote()
  
      # Test the GCS recorded case.
      expected = {
          "Actor1": 1,
          "Actor2": 1,
      }
      wait_for_condition(
          lambda: actors_by_name(info) == expected,
          timeout=20,
          retry_interval_ms=500,
      )
  
      # Also test the core worker recorded case.
      a.sleep.remote()
      b.sleep.remote()
      time.sleep(1)
      wait_for_condition(
          lambda: actors_by_name(info) == expected,
          timeout=20,
          retry_interval_ms=500,
      )
  
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 8 for calling a global function with example usage: test_tracking_by_name(shutdown_only) without return types