From 4aa7dca862a4e7ca7a6a09174e4b3d82bbfc1653 Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Fri, 11 Oct 2024 15:43:34 -0400 Subject: [PATCH] test: disable tablets in topology/test_mutation_schema_change.py This test uses lightweight transactions, which are not enabled with tablets keyspaces. --- test/pylib/random_tables.py | 7 ++++++- test/pytest.ini | 1 + test/topology/conftest.py | 5 ++++- test/topology/test_mutation_schema_change.py | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/test/pylib/random_tables.py b/test/pylib/random_tables.py index 7235253506..1191cfda47 100644 --- a/test/pylib/random_tables.py +++ b/test/pylib/random_tables.py @@ -266,8 +266,13 @@ class RandomTables(): """A list of managed random tables""" def __init__(self, test_name: str, manager: ManagerClient, keyspace: str, - replication_factor: int, dc_replication_factor: dict[str, int] = None): + replication_factor: int, + dc_replication_factor: dict[str, int] = None, + enable_tablets: None | bool = None): keyspace_query = f"CREATE KEYSPACE IF NOT EXISTS {keyspace} WITH REPLICATION = {{ 'class' : 'NetworkTopologyStrategy', 'replication_factor' : {replication_factor}}}" + if enable_tablets is not None: + enable_tablets = str(enable_tablets).lower() + keyspace_query += f" AND TABLETS = {{'enabled': {enable_tablets} }}" self.test_name = test_name self.manager = manager self.keyspace = keyspace diff --git a/test/pytest.ini b/test/pytest.ini index 58af2382c8..5a54cd42d1 100644 --- a/test/pytest.ini +++ b/test/pytest.ini @@ -8,6 +8,7 @@ markers = slow: tests that take more than 30 seconds to run replication_factor: replication factor for RandomTables without_scylla: run without attaching to a scylla process + enable_tablets: create keyspace with tablets enabled or disabled norecursedirs = manual perf lib # Ignore warnings about HTTPS requests without certificate verification # (see issue #15287). Pytest breaks urllib3.disable_warnings() in conftest.py, diff --git a/test/topology/conftest.py b/test/topology/conftest.py index db8170bde1..b23c12ef57 100644 --- a/test/topology/conftest.py +++ b/test/topology/conftest.py @@ -230,7 +230,10 @@ def cql(manager): async def random_tables(request, manager): rf_marker = request.node.get_closest_marker("replication_factor") replication_factor = rf_marker.args[0] if rf_marker is not None else 3 # Default 3 - tables = RandomTables(request.node.name, manager, unique_name(), replication_factor) + enable_tablets = request.node.get_closest_marker("enable_tablets") + enable_tablets = enable_tablets.args[0] if enable_tablets is not None else None + tables = RandomTables(request.node.name, manager, unique_name(), + replication_factor, None, enable_tablets) yield tables # Don't drop tables at the end if we failed or the cluster is dirty - it may be impossible diff --git a/test/topology/test_mutation_schema_change.py b/test/topology/test_mutation_schema_change.py index a6ffba0681..3e2a18e3de 100644 --- a/test/topology/test_mutation_schema_change.py +++ b/test/topology/test_mutation_schema_change.py @@ -20,6 +20,7 @@ logger = logging.getLogger(__name__) @pytest.mark.asyncio +@pytest.mark.enable_tablets(False) # uses lightweight transactions async def test_mutation_schema_change(manager, random_tables): """ Cluster A, B, C @@ -81,6 +82,7 @@ async def test_mutation_schema_change(manager, random_tables): @pytest.mark.asyncio +@pytest.mark.enable_tablets(False) # uses lightweight transactions async def test_mutation_schema_change_restart(manager, random_tables): """ Cluster A, B, C