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

cloud_storage/tests: match topic name when deleting manifest #5721

Merged
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
6 changes: 4 additions & 2 deletions tests/rptest/tests/topic_recovery_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ class MissingPartition(BaseCase):
only one key).
"""

topics = (TopicSpec(name='panda-topic',
topic_name = 'panda-topic'
topics = (TopicSpec(name=topic_name,
Comment on lines -348 to +349
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than doing this, access the name from the topicspec: self.topic is a shortcut if there is exactly one topic, or self.topics[n].name if you have more than one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, I tried this on another PR to sneak in this change there, but it seems this property is only defined for RedpandaTest in rptest.tests.redpanda_test.RedpandaTest.topic whereas this code uses rptest.tests.topic_recovery_test.MissingPartition inherited from rptest.tests.topic_recovery_test.BaseCase neither of which have this property.

It might be good to define a similar property on this test case.

partition_count=2,
replication_factor=3), )

Expand Down Expand Up @@ -377,8 +378,9 @@ def _find_and_remove_partition_manifest(self):
consistent in Minio S3 implementation)."""
manifest = None
for key in self._list_objects():
if key.endswith("/manifest.json"):
if key.endswith("/manifest.json") and self.topic_name in key:
attr = parse_s3_manifest_path(key)
assert attr.ntp.topic == self.topic_name
if attr.ntp.partition == 0:
manifest = key
else:
Expand Down