Skip to content

Commit 0c13134

Browse files
authored
Merge pull request #708 from piodul/fix-flaky-tracing
session_test: fix flakiness due to slow Cassandra tracing
2 parents 66bd241 + 61ad878 commit 0c13134

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

scylla/src/transport/session_test.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,14 @@ async fn test_token_awareness() {
562562
.unwrap();
563563
prepared_statement.set_tracing(true);
564564

565+
// The Cassandra cluster in CI is quite slow, so we use a quite forgiving
566+
// configuration here (wait at most 10 seconds)
567+
let get_tracing_config = GetTracingConfig {
568+
attempts: NonZeroU32::new(50).unwrap(),
569+
interval: Duration::from_millis(200),
570+
consistency: Consistency::One,
571+
};
572+
565573
// The default policy should be token aware
566574
for size in 1..50usize {
567575
let key = vec!['a'; size].into_iter().collect::<String>();
@@ -570,7 +578,7 @@ async fn test_token_awareness() {
570578
// Execute a query and observe tracing info
571579
let res = session.execute(&prepared_statement, values).await.unwrap();
572580
let tracing_info = session
573-
.get_tracing_info(res.tracing_id.as_ref().unwrap())
581+
.get_tracing_info_custom(res.tracing_id.as_ref().unwrap(), &get_tracing_config)
574582
.await
575583
.unwrap();
576584

@@ -583,7 +591,10 @@ async fn test_token_awareness() {
583591
.await
584592
.unwrap();
585593
let tracing_id = iter.get_tracing_ids()[0];
586-
let tracing_info = session.get_tracing_info(&tracing_id).await.unwrap();
594+
let tracing_info = session
595+
.get_tracing_info_custom(&tracing_id, &get_tracing_config)
596+
.await
597+
.unwrap();
587598

588599
// Again, verify that only one node was involved
589600
assert_eq!(tracing_info.nodes().len(), 1);

0 commit comments

Comments
 (0)