Skip to content

Commit

Permalink
Tests: Change the way tablet support is checked
Browse files Browse the repository at this point in the history
Fixes: #1048

See the issue description for more information.
  • Loading branch information
Lorak-mmk committed Nov 20, 2024
1 parent 3b2963b commit f87e133
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
15 changes: 1 addition & 14 deletions scylla/src/utils/test_utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::transport::session_builder::{GenericSessionBuilder, SessionBuilderKind};
use crate::Session;
use scylla_cql::frame::response::result::Row;
use std::{num::NonZeroU32, time::Duration};
use std::{
sync::atomic::{AtomicUsize, Ordering},
Expand Down Expand Up @@ -92,19 +91,7 @@ pub(crate) fn create_new_session_builder() -> GenericSessionBuilder<impl Session
}

pub(crate) async fn scylla_supports_tablets(session: &Session) -> bool {
let result = session
.query_unpaged(
"select column_name from system_schema.columns where
keyspace_name = 'system_schema'
and table_name = 'scylla_keyspaces'
and column_name = 'initial_tablets'",
&[],
)
.await
.unwrap()
.into_rows_result();

result.is_ok_and(|rows_result| rows_result.single_row::<Row>().is_ok())
supports_feature(session, "TABLETS").await
}

pub(crate) fn setup_tracing() {
Expand Down
15 changes: 1 addition & 14 deletions scylla/tests/integration/utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use futures::Future;
use scylla::deserialize::DeserializeValue;
use scylla::frame::response::result::Row;
use scylla::transport::session_builder::{GenericSessionBuilder, SessionBuilderKind};
use scylla::Session;
use std::collections::HashMap;
Expand Down Expand Up @@ -123,19 +122,7 @@ pub(crate) async fn supports_feature(session: &Session, feature: &str) -> bool {

#[allow(unused)]
pub(crate) async fn scylla_supports_tablets(session: &Session) -> bool {
let result = session
.query_unpaged(
"select column_name from system_schema.columns where
keyspace_name = 'system_schema'
and table_name = 'scylla_keyspaces'
and column_name = 'initial_tablets'",
&[],
)
.await
.unwrap()
.into_rows_result();

result.is_ok_and(|rows_result| rows_result.single_row::<Row>().is_ok())
supports_feature(session, "TABLETS").await
}

// Creates a generic session builder based on conditional compilation configuration
Expand Down

0 comments on commit f87e133

Please sign in to comment.