Skip to content

Commit

Permalink
Merge pull request #11339 from dlex/11338/duplicate-group-names-in-test
Browse files Browse the repository at this point in the history
Avoid duplicate group names in the test in snc trhoughput config test
  • Loading branch information
dlex authored Jun 13, 2023
2 parents 951ea94 + cf8e16b commit f9de4c6
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/rptest/tests/throughput_limits_snc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,27 @@ def get_config_parameter_random_value(self, prop: ConfigProp):
if prop == self.ConfigProp.THROUGHPUT_CONTROL:
throughput_control = []
letters = string.digits + string.ascii_letters + ' '
group_names = set()
for _ in range(self.rnd.randrange(4)):
tc_item = {}

r = self.rnd.randrange(3)
if r != 0:
tc_item['name'] = ''.join(
self.rnd.choice(letters)
for _ in range(self.binexp_random(0, 512)))
while True:
new_name = ''.join(
self.rnd.choice(letters)
for _ in range(self.binexp_random(0, 512)))
if new_name not in group_names:
break
tc_item['name'] = new_name
group_names.add(new_name)

r = self.rnd.randrange(3)
if r == 0:
tc_item['client_id'] = 'client_id 1'
elif r == 2:
tc_item['client_id'] = 'client_\d+'

throughput_control.append(tc_item)
return throughput_control

Expand Down

0 comments on commit f9de4c6

Please sign in to comment.