Skip to content

Commit f3c8092

Browse files
committed
Fix tests to match new shuffle_replicas default
1 parent 2ad9ba6 commit f3c8092

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/unit/advanced/test_insights.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def test_execution_profile(self):
126126
'options': {'local_dc': '',
127127
'used_hosts_per_remote_dc': 0},
128128
'type': 'DCAwareRoundRobinPolicy'},
129-
'shuffle_replicas': False},
129+
'shuffle_replicas': True},
130130
'type': 'TokenAwarePolicy'},
131131
'readTimeout': 10.0,
132132
'retry': {'namespace': 'cassandra.policies', 'options': {}, 'type': 'RetryPolicy'},
@@ -145,7 +145,7 @@ def test_graph_execution_profile(self):
145145
'options': {'local_dc': '',
146146
'used_hosts_per_remote_dc': 0},
147147
'type': 'DCAwareRoundRobinPolicy'},
148-
'shuffle_replicas': False},
148+
'shuffle_replicas': True},
149149
'type': 'TokenAwarePolicy'},
150150
'readTimeout': 30.0,
151151
'retry': {'namespace': 'cassandra.policies', 'options': {}, 'type': 'NeverRetryPolicy'},
@@ -167,7 +167,7 @@ def test_graph_analytics_execution_profile(self):
167167
'options': {'local_dc': '',
168168
'used_hosts_per_remote_dc': 0},
169169
'type': 'DCAwareRoundRobinPolicy'},
170-
'shuffle_replicas': False},
170+
'shuffle_replicas': True},
171171
'type': 'TokenAwarePolicy'}},
172172
'type': 'DefaultLoadBalancingPolicy'},
173173
'readTimeout': 604800.0,
@@ -195,7 +195,7 @@ def test_token_aware_policy(self):
195195
'options': {'child_policy': {'namespace': 'cassandra.policies',
196196
'options': {},
197197
'type': 'LoadBalancingPolicy'},
198-
'shuffle_replicas': False},
198+
'shuffle_replicas': True},
199199
'type': 'TokenAwarePolicy'}
200200

201201
def test_whitelist_round_robin_policy(self):

tests/unit/test_policies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,14 +604,14 @@ def get_replicas(keyspace, packed_key):
604604

605605
replicas = get_replicas(None, struct.pack('>i', i))
606606
other = set(h for h in hosts if h not in replicas)
607-
assert replicas == qplan[:2]
607+
assert sorted(replicas) == sorted(qplan[:2])
608608
assert other == set(qplan[2:])
609609

610610
# Should use the secondary policy
611611
for i in range(4):
612612
qplan = list(policy.make_query_plan())
613613

614-
assert set(qplan) == set(hosts)
614+
assert sorted(set(qplan)) == sorted(set(hosts))
615615

616616
def test_wrap_dc_aware(self):
617617
cluster = Mock(spec=Cluster)

0 commit comments

Comments
 (0)