Skip to content

Commit

Permalink
tests: replace deprecated min/max with constraints
Browse files Browse the repository at this point in the history
Signed-off-by: NyaliaLui <[email protected]>
  • Loading branch information
NyaliaLui committed Nov 3, 2023
1 parent 1aa1f5e commit cd75fde
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/rptest/scale_tests/many_partitions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def __init__(self, test_ctx, *args, **kwargs):
# cloud segments as possible. To that end, bounding the segment
# size isn't productive.
'cloud_storage_segment_size_min': 1,
'log_segment_size_min': 1024,
'constraints': ['name': 'log_segment_size', 'type': 'clamp', 'min': 1024],

# Disable segment merging: when we create many small segments
# to pad out tiered storage metadata, we don't want them to
Expand Down
14 changes: 11 additions & 3 deletions tests/rptest/tests/e2e_shadow_indexing_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,17 @@ def __init__(self, test_context):
extra_rp_conf={
# Avoid segment merging so we can generate many segments
# quickly.
"cloud_storage_enable_segment_merging": False,
'log_segment_size_min': 1024,
'cloud_storage_cache_chunk_size': self.chunk_size,
"cloud_storage_enable_segment_merging":
False,
'log_segment_size_min':
1024,
'constraints': [{
'name': 'log_segment_size',
'type': 'clamp',
'min': 1024
}],
'cloud_storage_cache_chunk_size':
self.chunk_size,
},
environment={'__REDPANDA_TOPIC_REC_DL_CHECK_MILLIS': 5000},
si_settings=si_settings,
Expand Down
26 changes: 20 additions & 6 deletions tests/rptest/tests/log_segment_ms_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,12 @@ def test_segment_rolling(self, server_cfg, topic_cfg, use_alter_cfg):
use_alter_cfg,
num_messages,
extra_cluster_cfg={
'log_segment_ms_min': TEST_LOG_SEGMENT_MIN,
'log_segment_ms_max': TEST_LOG_SEGMENT_MAX
'constraints': [{
'name': 'log_segment_ms',
'type': 'clamp',
'min': TEST_LOG_SEGMENT_MIN,
'max': TEST_LOG_SEGMENT_MAX
}]
})
assert abs((stop_count - start_count) - TEST_NUM_SEGMENTS) <= ERROR_MARGIN, \
f"{stop_count=}-{start_count=} != {TEST_NUM_SEGMENTS=} +-{ERROR_MARGIN=}"
Expand Down Expand Up @@ -207,8 +211,13 @@ def test_segment_timely_rolling_after_change(self):
@cluster(num_nodes=3)
def test_segment_rolling_with_retention(self):
self.redpanda.set_cluster_config({
"log_segment_ms": None,
"log_segment_ms_min": 10000
"log_segment_ms":
None,
'constraints': [{
'name': 'log_segment_ms',
'type': 'clamp',
'min': 10000
}]
})
topic = TopicSpec(segment_bytes=(1024 * 1024),
replication_factor=1,
Expand Down Expand Up @@ -278,8 +287,13 @@ def test_segment_rolling_with_retention(self):
@cluster(num_nodes=4)
def test_segment_rolling_with_retention_consumer(self):
self.redpanda.set_cluster_config({
"log_segment_ms": None,
"log_segment_ms_min": 10000
"log_segment_ms":
None,
'constraints': [{
'name': 'log_segment_ms',
'type': 'clamp',
'min': 10000
}]
})
topic = TopicSpec(segment_bytes=(1024 * 1024),
replication_factor=1,
Expand Down
7 changes: 5 additions & 2 deletions tests/rptest/tests/timequery_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,11 @@ def set_up_cluster(self, cloud_storage: bool, batch_cache: bool,
# staying in one place.
'enable_leader_balancer':
False,
'log_segment_size_min':
32 * 1024,
'constraints': [{
'name': 'log_segment_size',
'type': 'clamp',
'min': 32 * 1024
}],
'cloud_storage_cache_chunk_size':
self.chunk_size
})
Expand Down

0 comments on commit cd75fde

Please sign in to comment.