Skip to content

Commit f87e133

Browse files
committed
Tests: Change the way tablet support is checked
Fixes: #1048 See the issue description for more information.
1 parent 3b2963b commit f87e133

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

scylla/src/utils/test_utils.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::transport::session_builder::{GenericSessionBuilder, SessionBuilderKind};
22
use crate::Session;
3-
use scylla_cql::frame::response::result::Row;
43
use std::{num::NonZeroU32, time::Duration};
54
use std::{
65
sync::atomic::{AtomicUsize, Ordering},
@@ -92,19 +91,7 @@ pub(crate) fn create_new_session_builder() -> GenericSessionBuilder<impl Session
9291
}
9392

9493
pub(crate) async fn scylla_supports_tablets(session: &Session) -> bool {
95-
let result = session
96-
.query_unpaged(
97-
"select column_name from system_schema.columns where
98-
keyspace_name = 'system_schema'
99-
and table_name = 'scylla_keyspaces'
100-
and column_name = 'initial_tablets'",
101-
&[],
102-
)
103-
.await
104-
.unwrap()
105-
.into_rows_result();
106-
107-
result.is_ok_and(|rows_result| rows_result.single_row::<Row>().is_ok())
94+
supports_feature(session, "TABLETS").await
10895
}
10996

11097
pub(crate) fn setup_tracing() {

scylla/tests/integration/utils.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use futures::Future;
22
use scylla::deserialize::DeserializeValue;
3-
use scylla::frame::response::result::Row;
43
use scylla::transport::session_builder::{GenericSessionBuilder, SessionBuilderKind};
54
use scylla::Session;
65
use std::collections::HashMap;
@@ -123,19 +122,7 @@ pub(crate) async fn supports_feature(session: &Session, feature: &str) -> bool {
123122

124123
#[allow(unused)]
125124
pub(crate) async fn scylla_supports_tablets(session: &Session) -> bool {
126-
let result = session
127-
.query_unpaged(
128-
"select column_name from system_schema.columns where
129-
keyspace_name = 'system_schema'
130-
and table_name = 'scylla_keyspaces'
131-
and column_name = 'initial_tablets'",
132-
&[],
133-
)
134-
.await
135-
.unwrap()
136-
.into_rows_result();
137-
138-
result.is_ok_and(|rows_result| rows_result.single_row::<Row>().is_ok())
125+
supports_feature(session, "TABLETS").await
139126
}
140127

141128
// Creates a generic session builder based on conditional compilation configuration

0 commit comments

Comments
 (0)