'Test to validate the hosts are shuffled when the `shuffle_replicas` is truthy
@since 3.8
@jira_ticket PYTHON-676
@expected_result the request are spread across the replicas,
when one of them is down, the requests target the other available ones
@test_category policy'

def test_token_aware_with_shuffle_rf3(self):

    keyspace = 'test_token_aware_with_rf_3'
    (cluster, session) = self._set_up_shuffle_test(keyspace, replication_factor=3)
    self._check_query_order_changes(session=session, keyspace=keyspace)
    self.coordinator_stats.reset_counts()
    stop(1)
    self._wait_for_nodes_down([1], cluster)
    self._query(session, keyspace)
    self.coordinator_stats.assert_query_count_equals(self, 1, 0)
    query_count_two = self.coordinator_stats.get_query_count(2)
    query_count_three = self.coordinator_stats.get_query_count(3)
    self.assertEqual((query_count_two + query_count_three), 12)
    self.coordinator_stats.reset_counts()
    stop(2)
    self._wait_for_nodes_down([2], cluster)
    self._query(session, keyspace)
    self.coordinator_stats.assert_query_count_equals(self, 1, 0)
    self.coordinator_stats.assert_query_count_equals(self, 2, 0)
    self.coordinator_stats.assert_query_count_equals(self, 3, 12)
    cluster.shutdown()
