mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-28 12:17:02 +00:00
test: disable tablets in topology/test_mutation_schema_change.py
This test uses lightweight transactions, which are not enabled with tablets keyspaces.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user