Skip to content

Commit fe57308

Browse files
committed
session_test: Increase tracing info timeout
Default values for fetching tracing info are quite strict in the driver: it will make 5 attempts to fetch the data, waiting 3ms between attempts. For Scylla this is enough, but for Cassandra it is not. For this reason our tests sometimes fail. This was partially (for one test) fixed previously: 61ad878 This commit fixes rest of the tests in session_test that could be affected. It also changes timeout parameters. Previous fixed used 50 attempts with 200ms wait, I changed it to 200 attempts with 50ms wait in order to not slow down Scylla tests unnecessarily.
1 parent cf0b1cd commit fe57308

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

scylla/src/transport/session_test.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,11 @@ async fn assert_in_tracing_table(session: &Session, tracing_uuid: Uuid) {
10541054
// Tracing info might not be immediately available
10551055
// If rows are empty perform 8 retries with a 32ms wait in between
10561056

1057-
for _ in 0..8 {
1057+
// The reason why we enable so long waiting for TracingInfo is... Cassandra. (Yes, again.)
1058+
// In Cassandra Java Driver, the wait time for tracing info is 10 seconds, so here we do the same.
1059+
// However, as Scylla usually gets TracingInfo ready really fast (our default interval is hence 3ms),
1060+
// we stick to a not-so-much-terribly-long interval here.
1061+
for _ in 0..200 {
10581062
let rows_num = session
10591063
.query(traces_query.clone(), (tracing_uuid,))
10601064
.await
@@ -1068,7 +1072,7 @@ async fn assert_in_tracing_table(session: &Session, tracing_uuid: Uuid) {
10681072
}
10691073

10701074
// Otherwise retry
1071-
tokio::time::sleep(std::time::Duration::from_millis(32)).await;
1075+
tokio::time::sleep(std::time::Duration::from_millis(50)).await;
10721076
}
10731077

10741078
// If all retries failed panic with an error

scylla/src/utils/test_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ pub fn create_new_session_builder() -> GenericSessionBuilder<impl SessionBuilder
8989
// However, as Scylla usually gets TracingInfo ready really fast (our default interval is hence 3ms),
9090
// we stick to a not-so-much-terribly-long interval here.
9191
session_builder
92-
.tracing_info_fetch_attempts(NonZeroU32::new(50).unwrap())
93-
.tracing_info_fetch_interval(Duration::from_millis(200))
92+
.tracing_info_fetch_attempts(NonZeroU32::new(200).unwrap())
93+
.tracing_info_fetch_interval(Duration::from_millis(50))
9494
}
9595

9696
#[cfg(test)]

0 commit comments

Comments
 (0)