Skip to content

Commit

Permalink
tests: fix rare failure in TopicDeleteCloudStorageTest
Browse files Browse the repository at this point in the history
This affected the new topic_delete_unavailable_test but
also existing tests.

Test intended to write 10MB of data per partition (i.e.
10 1MB segments), but was actually writing 10MB total
across 3 partitions.  wait_for_segments_removal(5) was
proceeding immediately because partitions only had
~3 partitions to begin with.
  • Loading branch information
jcsp committed Nov 24, 2022
1 parent 0113f22 commit 5f95949
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/rptest/tests/topic_delete_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def produce_until_partitions():


class TopicDeleteCloudStorageTest(RedpandaTest):
topics = (TopicSpec(partition_count=3,
partition_count = 3
topics = (TopicSpec(partition_count=partition_count,
cleanup_policy=TopicSpec.CLEANUP_DELETE), )

def __init__(self, test_context):
Expand All @@ -100,13 +101,13 @@ def _populate_topic(self, topic_name):
self.kafka_tools.alter_topic_config(
topic_name, {'retention.local.target.bytes': 5 * 1024 * 1024})

# Write out 10MB
# Write out 10MB per partition
self.kafka_tools.produce(topic_name,
record_size=4096,
num_records=2560)
num_records=2560 * self.partition_count)

# Wait for segments evicted from local storage
for i in range(0, 3):
for i in range(0, self.partition_count):
wait_for_segments_removal(self.redpanda, topic_name, i, 5)

# Confirm objects in remote storage
Expand Down Expand Up @@ -158,7 +159,7 @@ def topic_delete_unavailable_test(self):
next_topic = "next_topic"
self.kafka_tools.create_topic(
TopicSpec(name=next_topic,
partition_count=3,
partition_count=self.partition_count,
cleanup_policy=TopicSpec.CLEANUP_DELETE))
self._populate_topic(next_topic)
after_keys = set([
Expand Down

0 comments on commit 5f95949

Please sign in to comment.