def test_kafka_on_networks(monkeypatch: pytest.MonkeyPatch):
    """
    this test case comes from testcontainers/testcontainers-python#637
    """
    monkeypatch.setattr(kafka_config, "limit_broker_to_first_host", True)

    with Network() as network:
        kafka_ctr = KafkaContainer()
        kafka_ctr.with_network(network)
        kafka_ctr.with_network_aliases("kafka")

        with kafka_ctr:
            print("started")  # Will not reach here and timeout
            admin_client = KafkaAdminClient(bootstrap_servers=[kafka_ctr.get_bootstrap_server()])
            print(admin_client.describe_cluster())

    this test case comes from testcontainers/testcontainers-python#637
    
modules/kafka/tests/test_kafka.py