Skip to content

Commit a8de8ab

Browse files
committed
Added logs in test_replicas_are_queried
1 parent ef96c16 commit a8de8ab

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tests/integration/standard/test_cluster.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,6 @@ def test_replicas_are_queried(self):
10291029
10301030
@test_category metadata
10311031
"""
1032-
queried_hosts = set()
10331032
with Cluster(protocol_version=PROTOCOL_VERSION,
10341033
load_balancing_policy=TokenAwarePolicy(RoundRobinPolicy())) as cluster:
10351034
session = cluster.connect(wait_for_all_pools=True)
@@ -1049,17 +1048,21 @@ def test_replicas_are_queried(self):
10491048

10501049
only_replica = queried_hosts.pop()
10511050
available_hosts = [host for host in ["127.0.0.1", "127.0.0.2", "127.0.0.3"] if host != only_replica]
1051+
print(available_hosts)
10521052
with Cluster(contact_points=available_hosts,
10531053
protocol_version=PROTOCOL_VERSION,
10541054
load_balancing_policy=HostFilterPolicy(RoundRobinPolicy(),
1055-
predicate=lambda host: host.address != only_replica)) as cluster:
1055+
predicate=lambda host: host.address != only_replica)) as cluster:
10561056

10571057
session = cluster.connect(wait_for_all_pools=True)
10581058
prepared = session.prepare("""SELECT * from test1rf.table_with_big_key
10591059
WHERE k1 = ? AND k2 = ? AND k3 = ? AND k4 = ?""")
10601060
for _ in range(10):
10611061
result = session.execute(prepared, (last_i, last_i, last_i, last_i), trace=True)
1062-
self._assert_replica_queried(result.get_query_trace(), only_replicas=False)
1062+
try:
1063+
self._assert_replica_queried(result.get_query_trace(), only_replicas=False)
1064+
except AssertionError as e:
1065+
raise Exception(str(e) + ", replica: {}".format(only_replica))
10631066

10641067
session.execute('''DROP TABLE test1rf.table_with_big_key''')
10651068

0 commit comments

Comments
 (0)