code: def test_placement_ready(ray_start_regular, connect_to_client):
      @ray.remote
      class Actor:
          def __init__(self):
              pass
  
          def v(self):
              return 10
  
      # bundle is placement group reserved resources and can't be used in bundles
      with pytest.raises(Exception):
          ray.util.placement_group(bundles=[{"bundle": 1}])
      # This test is to test the case that even there all resource in the
      # bundle got allocated, we are still able to return from ready[I
      # since ready use 0 CPU
      with connect_to_client_or_not(connect_to_client):
          pg = ray.util.placement_group(bundles=[{"CPU": 1}])
          ray.get(pg.ready())
          a = Actor.options(
              num_cpus=1,
              scheduling_strategy=PlacementGroupSchedulingStrategy(
                  placement_group=pg
              ),
          ).remote()
          ray.get(a.v.remote())
          ray.get(pg.ready())
  
          placement_group_assert_no_leak([pg])
  
imports: import sys
  import warnings
  import os
  import pytest
  import ray
  from ray._private.utils import get_ray_doc_version
  import ray.cluster_utils
  from ray._private.test_utils import placement_group_assert_no_leak
  from ray._private.test_utils import skip_flaky_core_test_premerge
  from ray.util.client.ray_client_helpers import connect_to_client_or_not
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
label_desc: Use image node_id 2 for calling a global function with example usage: test_placement_ready(ray_start_regular, connect_to_client) and returns: int