Skip to content

Commit

Permalink
DROP ME! tests: use less partitions in rack aware placement test for …
Browse files Browse the repository at this point in the history
…debug builds

Debugs builds are really slow because of default allocator and  sanitizer overhead.
Use less partitions in debug builds to make test more reliable.

Fixes: #6248

Signed-off-by: Michal Maslanka <michal@redpanda.com>
  • Loading branch information
mmaslankaprv authored and rystsov committed Aug 31, 2022
1 parent c5722fc commit c066a0a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/rptest/tests/rack_aware_replica_placement_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# by the Apache License, Version 2.0

import random
import os
from ducktape.utils.util import wait_until
from ducktape.mark import matrix
from ducktape.mark import ok_to_fail
Expand Down Expand Up @@ -150,6 +151,13 @@ def test_replica_placement(self, rack_layout_str, num_partitions,
for topic in topics:
self._validate_placement(topic, rack_layout, replication_factor)

def _partition_count(self):
# use smaller number of partitions for debug builds
if os.environ.get('BUILD_TYPE', None) == 'debug':
return random.randint(20, 40)

return random.randint(200, 300)

@cluster(num_nodes=6)
@matrix(rack_layout=['ABCDEF', 'xxYYzz', 'ooooFF'])
def test_rack_awareness_after_node_operations(self, rack_layout):
Expand All @@ -168,7 +176,7 @@ def test_rack_awareness_after_node_operations(self, rack_layout):
self.redpanda.start()
self._client = DefaultClient(self.redpanda)

topic = TopicSpec(partition_count=random.randint(200, 300),
topic = TopicSpec(partition_count=self._partition_count(),
replication_factor=replication_factor)
self.client().create_topic(topic)
self._validate_placement(topic, rack_layout, replication_factor)
Expand Down

0 comments on commit c066a0a

Please sign in to comment.