Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v23.3.x] tests: fixed test validating disk size when moving with local retention #19961

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions tests/rptest/tests/scaling_up_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ def print_disk_usage(usage):
self.logger.info(
f"node: {n} total partitions size: {b/(1024*1024):02} Mb")

def verify_node_disk_usage(nodes, node_id):
def disk_usage_correct(nodes, node_id):
size_per_node = self._partition_sizes(topic.name, nodes)
print_disk_usage(size_per_node)
replicas_per_node = self._topic_replicas_per_node()
Expand All @@ -586,20 +586,28 @@ def verify_node_disk_usage(nodes, node_id):
self.logger.info(
f"node {node_id} target size: {target_size}, current size: {size_per_node[node_id]}, expected range ({min}, {max})"
)
assert current_usage > min and current_usage < max, \
f"node {node_id} disk usage should be withing the range ({min}, {max}). Current value: {current_usage} "
return current_usage > min and current_usage < max

first_new_id = self.redpanda.node_id(self.redpanda.nodes[4])

verify_node_disk_usage(self.redpanda.nodes[0:5], first_new_id)
wait_until(
lambda: disk_usage_correct(self.redpanda.nodes[0:5], first_new_id),
timeout_sec=60,
backoff_sec=1,
err_msg="Timeout waiting for correct disk usage to be reported")

# add sixth node
self.redpanda.start_node(self.redpanda.nodes[5])
self.wait_for_partitions_rebalanced(total_replicas=total_replicas,
timeout_sec=self.rebalance_timeout)

next_new_id = self.redpanda.node_id(self.redpanda.nodes[5])
verify_node_disk_usage(self.redpanda.nodes, next_new_id)

wait_until(
lambda: disk_usage_correct(self.redpanda.nodes, next_new_id),
timeout_sec=60,
backoff_sec=1,
err_msg="Timeout waiting for correct disk usage to be reported")
# verify that data can be read
self.consumer = KgoVerifierSeqConsumer(self.test_context,
self.redpanda,
Expand Down
Loading