diff --git a/tests/rptest/clients/rpk.py b/tests/rptest/clients/rpk.py index 19937826703a..1b54591d004d 100644 --- a/tests/rptest/clients/rpk.py +++ b/tests/rptest/clients/rpk.py @@ -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"] = "-" @@ -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'] diff --git a/tests/rptest/tests/topic_delete_test.py b/tests/rptest/tests/topic_delete_test.py index 98b97a1351c0..066d97a37c1b 100644 --- a/tests/rptest/tests/topic_delete_test.py +++ b/tests/rptest/tests/topic_delete_test.py @@ -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, diff --git a/tests/rptest/utils/si_utils.py b/tests/rptest/utils/si_utils.py index 9dc199abd91f..4e3c7560ca5e 100644 --- a/tests/rptest/utils/si_utils.py +++ b/tests/rptest/utils/si_utils.py @@ -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 @@ -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: