Skip to content

Commit a185d4c

Browse files
committed
tablets IT: Return Result from populate_internal_driver_tablet_info
It will help us to introduce retries in the test.
1 parent 028e318 commit a185d4c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

scylla/tests/integration/load_balancing/tablets.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ async fn populate_internal_driver_tablet_info(
203203
prepared: &PreparedStatement,
204204
value_per_tablet: &[(i32, i32)],
205205
feedback_rxs: &mut [UnboundedReceiver<(ResponseFrame, Option<u16>)>],
206-
) {
206+
) -> Result<(), String> {
207207
// When the driver never received tablet info for any tablet in a given table,
208208
// then it will not be aware that the table is tablet-based and fall back
209209
// to token-ring routing for this table.
@@ -246,7 +246,15 @@ async fn populate_internal_driver_tablet_info(
246246
}
247247
}
248248

249-
assert_eq!(total_tablets_with_feedback, value_per_tablet.len());
249+
if total_tablets_with_feedback == value_per_tablet.len() {
250+
Ok(())
251+
} else {
252+
Err(format!(
253+
"Expected feedback for {} tablets, got it for {}",
254+
value_per_tablet.len(),
255+
total_tablets_with_feedback
256+
))
257+
}
250258
}
251259

252260
/// Tests that, when using DefaultPolicy with TokenAwareness and querying table
@@ -311,7 +319,8 @@ async fn test_default_policy_is_tablet_aware() {
311319
&value_lists,
312320
&mut feedback_rxs,
313321
)
314-
.await;
322+
.await
323+
.unwrap();
315324

316325
// Now we must have info about all the tablets. It should not be
317326
// possible to receive any feedback if DefaultPolicy is properly

0 commit comments

Comments
 (0)