From d20aed54a6548703fd64bfd7c9903a996043dc16 Mon Sep 17 00:00:00 2001 From: muzarski Date: Wed, 12 Jun 2024 14:58:49 +0200 Subject: [PATCH] test: disable tablets for tests with LWT (cherry picked from commit 5abc02fbeac7cfc69014ca7e1e279f45182401cf) --- scylla/src/transport/session_test.rs | 6 +++++- scylla/tests/integration/lwt_optimisation.rs | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scylla/src/transport/session_test.rs b/scylla/src/transport/session_test.rs index 8136477251..159dc8840f 100644 --- a/scylla/src/transport/session_test.rs +++ b/scylla/src/transport/session_test.rs @@ -2424,7 +2424,11 @@ async fn test_batch_lwts() { let session = create_new_session_builder().build().await.unwrap(); let ks = unique_keyspace_name(); - session.query(format!("CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}}", ks), &[]).await.unwrap(); + let mut create_ks = format!("CREATE KEYSPACE {} WITH REPLICATION = {{'class': 'NetworkTopologyStrategy', 'replication_factor': 1}}", ks); + if scylla_supports_tablets(&session).await { + create_ks += " and TABLETS = { 'enabled': false}"; + } + session.query(create_ks, &[]).await.unwrap(); session.use_keyspace(ks.clone(), false).await.unwrap(); session diff --git a/scylla/tests/integration/lwt_optimisation.rs b/scylla/tests/integration/lwt_optimisation.rs index a36d7367de..da2c89bdef 100644 --- a/scylla/tests/integration/lwt_optimisation.rs +++ b/scylla/tests/integration/lwt_optimisation.rs @@ -1,5 +1,6 @@ use crate::utils::{setup_tracing, test_with_3_node_cluster}; use scylla::retry_policy::FallthroughRetryPolicy; +use scylla::test_utils::scylla_supports_tablets; use scylla::test_utils::unique_keyspace_name; use scylla::transport::session::Session; use scylla::{ExecutionProfile, SessionBuilder}; @@ -68,7 +69,11 @@ async fn if_lwt_optimisation_mark_offered_then_negotiatied_and_lwt_routed_optima // Create schema let ks = unique_keyspace_name(); - session.query(format!("CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 3}}", ks), &[]).await.unwrap(); + let mut create_ks = format!("CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 3}}", ks); + if scylla_supports_tablets(&session).await { + create_ks += " and TABLETS = { 'enabled': false}"; + } + session.query(create_ks, &[]).await.unwrap(); session.use_keyspace(ks, false).await.unwrap(); session