'Test to ensure that cluster.connect() doesn\'t return prior to pools being initialized.
This test will figure out which host our pool logic will connect to first. It then shuts that server down.
Previously the cluster.connect() would return prior to the pools being initialized, and the first queries would
return a no host exception
@since 3.7.0
@jira_ticket PYTHON-617
@expected_result query should complete successfully
@test_category connection'

def test_pool_with_host_down(self):

    all_contact_points = ['127.0.0.1', '127.0.0.2', '127.0.0.3']
    cluster = Cluster(protocol_version=PROTOCOL_VERSION)
    cluster.connect(wait_for_all_pools=True)
    hosts = cluster.metadata.all_hosts()
    address = hosts[0].address
    node_to_stop = int(address.split('.')[(-1):][0])
    cluster.shutdown()
    contact_point = '127.0.0.{0}'.format(self.get_node_not_x(node_to_stop))
    cluster = Cluster(contact_points=[contact_point], protocol_version=PROTOCOL_VERSION)
    cluster.connect(wait_for_all_pools=True)
    try:
        force_stop(node_to_stop)
        wait_for_down(cluster, node_to_stop)
        cluster2 = Cluster(contact_points=all_contact_points, protocol_version=PROTOCOL_VERSION)
        session2 = cluster2.connect()
        session2.execute('SELECT    *    FROM    system.local')
    finally:
        cluster2.shutdown()
        start(node_to_stop)
        wait_for_up(cluster, node_to_stop)
        cluster.shutdown()
