From 822a131d3028fa3ebf3c12c8e4a2fa461535c1aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20M=C4=99drek?= Date: Tue, 8 Apr 2025 17:30:57 +0200 Subject: [PATCH] test/topology_custom/test_not_enough_token_owners.py: Adjust to RF-rack-validity We simply assign DC/rack properties to every node used in the test. We put all of them in the same DC to make sure that the cluster behaves as closely to how it would before these changes. However, we distribute them over multiple racks to ensure that the keyspace used in the test is RF-rack-valid, so we can also run it with the `rf_rack_valid_keyspaces` configuration option set to true. The distribution of nodes between racks has no effect on what the test does and verifies, so the changes are correct in that sense. (cherry picked from commit 73b22d4f6b2be52375e777fd9f61c5e31ff4d056) --- test/topology_custom/test_not_enough_token_owners.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/topology_custom/test_not_enough_token_owners.py b/test/topology_custom/test_not_enough_token_owners.py index a00a4cab4f..7472b98f54 100644 --- a/test/topology_custom/test_not_enough_token_owners.py +++ b/test/topology_custom/test_not_enough_token_owners.py @@ -23,14 +23,15 @@ async def test_not_enough_token_owners(manager: ManagerClient): """ logging.info('Trying to add a zero-token server as the first server in the cluster') await manager.server_add(config={'join_ring': False}, + property_file={"dc": "dc1", "rack": "rz"}, expected_error='Cannot start the first node in the cluster as zero-token') logging.info('Adding the first server') - server_a = await manager.server_add() + server_a = await manager.server_add(property_file={"dc": "dc1", "rack": "r1"}) logging.info('Adding two zero-token servers') # The second server is needed only to preserve the Raft majority. - server_b = (await manager.servers_add(2, config={'join_ring': False}))[0] + server_b = (await manager.servers_add(2, config={'join_ring': False}, property_file={"dc": "dc1", "rack": "rz"}))[0] logging.info(f'Trying to decommission the only token owner {server_a}') await manager.decommission_node(server_a.server_id, @@ -47,7 +48,7 @@ async def test_not_enough_token_owners(manager: ManagerClient): await manager.server_start(server_a.server_id) logging.info('Adding a normal server') - await manager.server_add() + await manager.server_add(property_file={"dc": "dc1", "rack": "r2"}) cql = manager.get_cql()