async def METHOD_NAME(logger, port_generator):
    connection_pool = GrpcConnectionPool(runtime_name='gateway')
    head_port = port_generator()
    head_address = f'0.0.0.0:{head_port}'
    head_deployment = 'head'
    executor_port = port_generator()
    executor_address = f'0.0.0.0:{executor_port}'
    executor_deployment = 'executor0'
    flow = (
        Flow()
        .add(name=head_deployment, port=head_port, shards=2, uses=DummyExecutor)
        .add(name=executor_deployment, port=executor_port, uses=DummyExecutor)
    )
    with flow:
        connection_pool.add_connection(
            deployment=head_deployment, address=head_address, head=True
        )
        response, _ = await connection_pool.send_discover_endpoint(
            deployment=head_deployment, head=True
        )
        assert set(response.endpoints) == {'/default', '_jina_dry_run_'}
        connection_pool.add_connection(
            deployment=executor_deployment, address=executor_address, head=False
        )
        response, _ = await connection_pool.send_discover_endpoint(
            deployment=executor_deployment, head=False
        )
        assert set(response.endpoints) == {'/default', '_jina_dry_run_'}