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

tests: fix call to quiesce_uploads in topic deletion test #11684

Merged
merged 3 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 1 addition & 4 deletions tests/rptest/clients/rpk.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ def int_or_none(value):
self._redpanda.logger.error(f"Missing columns: {missing_columns}")
raise RpkException(f"Missing columns: {missing_columns}")

partitions = []
for row in table.rows:
obj = dict()
obj["LAST-STABLE-OFFSET"] = "-"
Expand Down Expand Up @@ -440,9 +439,7 @@ def int_or_none(value):
start_offset=obj["LOG-START-OFFSET"])

if initialized or tolerant:
partitions.append(partition)

return iter(partitions)
yield partition

def describe_topic_configs(self, topic):
cmd = ['describe', topic, '-c']
Expand Down
2 changes: 1 addition & 1 deletion tests/rptest/tests/topic_delete_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def _populate_topic(self,

# Wait for everything to be uploaded: this avoids tests potentially trying
# to delete topics mid-uploads, which can leave orphan segments.
quiesce_uploads(self.redpanda, topic_name, timeout_sec=60)
quiesce_uploads(self.redpanda, [topic_name], timeout_sec=60)

@skip_debug_mode # Rely on timely uploads during leader transfers
@cluster(num_nodes=3,
Expand Down
8 changes: 8 additions & 0 deletions tests/rptest/utils/si_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,10 @@ def remote_has_reached_hwm(ntp: NTP, hwm: int):
rpk = RpkTool(redpanda)
for topic_name in topic_names:
described = rpk.describe_topic(topic_name)
p_count = 0
for p in described:
p_count += 1

ntp = NTP(ns='kafka', topic=topic_name, partition=p.id)
hwm = p.high_watermark

Expand All @@ -479,6 +482,11 @@ def remote_has_reached_hwm(ntp: NTP, hwm: int):
backoff_sec=1)
redpanda.logger.debug(f"Partition {ntp} ready (reached HWM {hwm})")

if p_count == 0:
# We expect to be called on a topic where `rpk topic describe` returns
# some data, otherwise we can't check that against cloud storage content
raise RuntimeError(f"Found 0 partitions for topic '{topic_name}'")


@dataclass(order=True)
class SpillMeta:
Expand Down