code: def test_placement_group_max_cpu_frac_multiple_pgs(ray_start_cluster):
      """
      Make sure when there's more than 1 pg, they respect the fraction.
      """
      cluster = ray_start_cluster
      cluster.add_node(num_cpus=8)
      cluster.wait_for_nodes()
      ray.init(address=cluster.address)
  
      # This pg should be scheduable.
      pg = ray.util.placement_group(
          [{"CPU": 4}], _max_cpu_fraction_per_node=0.5
      )
      ray.get(pg.ready())
  
      # When we schedule another placement group, it shouldn't be scheduled.
      pg2 = ray.util.placement_group(
          [{"CPU": 4}], _max_cpu_fraction_per_node=0.5
      )
      with pytest.raises(ray.exceptions.GetTimeoutError):
          ray.get(pg2.ready(), timeout=5)
  
      # When you add a new node, it is finally schedulable.
      cluster.add_node(num_cpus=8)
      ray.get(pg2.ready())
  
file_path: ray/python/ray/tests/test_placement_group_5.py
imports: import sys
  import pytest
  import ray
  from ray.tests.test_placement_group import are_pairwise_unique
  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 3 for calling a global function with example usage: test_placement_group_max_cpu_frac_multiple_pgs(ray_start_cluster) without return types