code: def server_actor_ref_count(server, n):
      assert server is not None
  
      def test_cond():
          if len(server.task_servicer.actor_refs) == 0:
              # No running actors
              return n == 0
          return len(server.task_servicer.actor_refs) == n
  
      return test_cond
  
file_path: ray/python/ray/tests/test_client_references.py
imports: from concurrent.futures import Future
  import pytest
  import ray
  from ray._private.test_utils import object_memory_usage, wait_for_condition
  from ray._raylet import ActorID, ObjectRef
  from ray.util.client import _ClientContext
  from ray.util.client.common import ClientActorRef, ClientObjectRef
  from ray.util.client.ray_client_helpers import ray_start_client_server, ray_start_client_server_pair, ray_start_cluster_client_server_pair
label_desc: Use image node_id 4 for calling a global function with example usage: server_actor_ref_count(server, n) and returns: test_cond, unknown, unknown