code: def test_add_pending(self, ray_start_regular_shared):
      # Test that pending actor is added in the correct state.
      pool = _ActorPool()
      actor = PoolWorker.remote()
      ready_ref = actor.get_location.remote()
      pool.add_pending_actor(actor, ready_ref)
      # Check that the pending actor is not pickable.
      assert pool.pick_actor() is None
      # Check that the per-state pool sizes are as expected.
      assert pool.num_total_actors() == 1
      assert pool.num_pending_actors() == 1
      assert pool.num_running_actors() == 0
      assert pool.num_active_actors() == 0
      assert pool.num_idle_actors() == 0
      assert pool.num_free_slots() == 0
      # Check that ready future is returned.
      assert pool.get_pending_actor_refs() == [ready_ref]
  
imports: import collections
  import time
  import pytest
  import ray
  from ray.data._internal.compute import ActorPoolStrategy
  from ray.data._internal.execution.operators.actor_pool_map_operator import AutoscalingConfig, AutoscalingPolicy, _ActorPool
  from ray.data._internal.execution.util import make_ref_bundles
  from ray.tests.conftest import *
label_desc: Use image node_id 2 for calling the TestActorPool obj's underlying member method code with example usage: obj.test_add_pending(ray_start_regular_shared) without return types