code: def test_pg_removed_after_controller_crash(serve_instance):
      """Verify that PGs are removed normally after recovering from a controller crash.
  
      If the placement group was not properly recovered in the replica recovery process,
      it would be leaked here.
      """
  
      @serve.deployment(
          placement_group_bundles=[{"CPU": 1}],
      )
      class D:
          pass
  
      serve.run(D.bind(), name="pg_test")
      assert len(get_all_live_placement_group_names()) == 1
  
      ray.kill(_get_global_client()._controller, no_restart=False)
  
      serve.delete("pg_test")
      assert len(get_all_live_placement_group_names()) == 0
  
file_path: ray/python/ray/serve/tests/test_replica_placement_group.py
imports: import os
  import sys
  import pytest
  import ray
  from ray import serve
  from ray._private.test_utils import wait_for_condition
  from ray.serve._private.utils import get_all_live_placement_group_names
  from ray.serve.context import _get_global_client
  from ray.util.placement_group import PlacementGroup, get_current_placement_group
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
label_desc: Use image node_id 6 for calling a global function with example usage: test_pg_removed_after_controller_crash(serve_instance) without return types