def test_router_hanging() -> None:
    """Run a separate process and check if greedy router hits timeout (20s)."""
    circuit, device_graph = create_circuit_and_device()
    process = Process(target=create_hanging_routing_instance, args=[circuit, device_graph])
    process.start()
    process.join(timeout=20)
    try:
        assert not process.is_alive(), "Greedy router timeout"
    finally:
        process.terminate()
Run a separate process and check if greedy router hits timeout (20s).
cirq-core/cirq/contrib/routing/greedy_test.py