Skip to content

Commit 60a1f03

Browse files
committed
tablets it: Return Result from verify_queries_routed_to_correct_tablets
It will make it easier to introduce retries in test_default_policy_is_tablet_aware.
1 parent 22c49ee commit 60a1f03

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

scylla/tests/integration/load_balancing/tablets.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ async fn verify_queries_routed_to_correct_tablets(
262262
prepared: &PreparedStatement,
263263
value_per_tablet: &[(i32, i32)],
264264
feedback_rxs: &mut [UnboundedReceiver<(ResponseFrame, Option<u16>)>],
265-
) {
265+
) -> Result<(), String> {
266266
for values in value_per_tablet.iter() {
267267
info!(
268268
"Second loop, trying key {:?}, token: {}",
@@ -273,8 +273,12 @@ async fn verify_queries_routed_to_correct_tablets(
273273
.await
274274
.unwrap();
275275
let feedbacks: usize = feedback_rxs.iter_mut().map(count_tablet_feedbacks).sum();
276-
assert_eq!(feedbacks, 0);
276+
if feedbacks != 0 {
277+
return Err(format!("Expected 0 tablet feedbacks, received {feedbacks}"));
278+
}
277279
}
280+
281+
Ok(())
278282
}
279283

280284
/// Tests that, when using DefaultPolicy with TokenAwareness and querying table
@@ -350,7 +354,8 @@ async fn test_default_policy_is_tablet_aware() {
350354
&value_lists,
351355
&mut feedback_rxs,
352356
)
353-
.await;
357+
.await
358+
.unwrap();
354359

355360
running_proxy
356361
},

0 commit comments

Comments
 (0)