From e6c2394655a2d0dc0a193e8a355f929c66d7a4f5 Mon Sep 17 00:00:00 2001 From: Andrea Barbadoro Date: Wed, 22 Mar 2023 23:11:52 +0100 Subject: [PATCH] tests/rptests: fixes to make it run at a basic level --- tests/rptest/services/redpanda_installer.py | 5 ++--- tests/rptest/services/workload_protocol.py | 4 ++-- tests/rptest/tests/upgrade_test.py | 11 +++++++---- tests/setup.py | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/rptest/services/redpanda_installer.py b/tests/rptest/services/redpanda_installer.py index 73a7d0e88cfe3..b5160e64e691c 100644 --- a/tests/rptest/services/redpanda_installer.py +++ b/tests/rptest/services/redpanda_installer.py @@ -441,11 +441,10 @@ def release_range( """ self.start() - self._initialize_released_versions() # default to oldest if not earliest: - earliest = self._released_versions[-1][0:2] + earliest = self.released_versions[-1][0:2] # convert to specific version if len(earliest) == 2: @@ -460,7 +459,7 @@ def release_range( latest, _ = self.latest_for_line(latest) # setup a copy (we are going to modify it) - rel_range = copy.deepcopy(self._released_versions) + rel_range = copy.deepcopy(self.released_versions) # glue head in front, as the most recent version rel_range.insert(0, self._head_version) diff --git a/tests/rptest/services/workload_protocol.py b/tests/rptest/services/workload_protocol.py index b8f0711c9b21f..bcb3428780594 100644 --- a/tests/rptest/services/workload_protocol.py +++ b/tests/rptest/services/workload_protocol.py @@ -46,8 +46,8 @@ def begin(self) -> None: """ return - def partial_progress(self, versions: map[Any, tuple[int, int, - int]]) -> int: + def partial_progress(self, versions: dict[Any, tuple[int, int, + int]]) -> int: """ This method is called while upgrading a cluster, after each node is upgraded. """ diff --git a/tests/rptest/tests/upgrade_test.py b/tests/rptest/tests/upgrade_test.py index b1c72ab7325e8..edf0f2cf6e8ab 100644 --- a/tests/rptest/tests/upgrade_test.py +++ b/tests/rptest/tests/upgrade_test.py @@ -655,12 +655,14 @@ def _expand_version(self, version: Optional[Union[str, tuple[int, int], # version is a release line, get latest minor for it return [v for v in self.upgrade_steps if v[0:2] == v][-1] + @cluster(num_nodes=3) def test_workloads_through_releases(self): current_version = self.upgrade_steps[0] rest_versions = self.upgrade_steps[1:] self.logger.info(f"installing base version {current_version}") self.installer.install(nodes=self.redpanda.nodes, version=current_version) + self.redpanda.start(clean_nodes=True) for next_version in rest_versions: # TODO final loop progress is not done at the moment to_check_workloads = self.not_started_workloads[:] @@ -682,7 +684,7 @@ def test_workloads_through_releases(self): w: w.progress(current_version) for w in to_check_workloads } - for w, state in status_progress: + for w, state in status_progress.items(): if state == PWorkload.DONE: self.logger.info( f"{w.get_workload_name()} progress check done") @@ -695,11 +697,12 @@ def test_workloads_through_releases(self): versions = {n: current_version for n in self.redpanda.nodes} for n in self.redpanda.nodes: self.installer.install(nodes=[n], version=next_version) + self.redpanda.restart_nodes(nodes=[n]) versions[n] = next_version # TODO move this to a lambda or private method, like the progress loop to_check_workloads = [ - self._expand_version(w.get_latest_applicable_release()) >= - next_version for w in self.active_workloads + w for w in self.active_workloads if self._expand_version( + w.get_latest_applicable_release()) >= next_version ] while len(to_check_workloads) > 0: self.logger.info( @@ -709,7 +712,7 @@ def test_workloads_through_releases(self): w: w.partial_progress(versions) for w in to_check_workloads } - for w, state in status_progress: + for w, state in status_progress.items(): if state == PWorkload.DONE: self.logger.info( f"{w.get_workload_name()} partial_progress check done" diff --git a/tests/setup.py b/tests/setup.py index b1ee9211fa8bc..f8ce3dc9f368d 100644 --- a/tests/setup.py +++ b/tests/setup.py @@ -20,7 +20,7 @@ 'psutil==5.9.0', 'numpy==1.22.3', 'pygal==3.0', 'pytest==7.1.2', 'jump-consistent-hash==3.2.0', 'azure-storage-blob==12.14.1', 'kafkatest@git+https://github.com/apache/kafka.git@058589b03db686803b33052d574ce887fb5cfbd1#egg=kafkatest&subdirectory=tests', - 'more-itertools>=9.0.0' + 'more-itertools==5.0.0' ], scripts=[], )