From e56acf9d6a4a9e6f7f24f3727c2cc3ac4fae91cd Mon Sep 17 00:00:00 2001 From: Rob Blafford Date: Tue, 28 May 2024 17:50:59 -0400 Subject: [PATCH] rptest: Fix for failing upgrade test - This upgrade test failed because the iterative upgrade through rp version loop wasn't waiting until the cluster active version had changed, between each install and upgrade of a new version. - It therefore isn't enough to wait until all binaries report the desired version, but for the cluster logical version to also have been bumped. - The solution is to use the already existing method `upgrade_through_versions` which properly waits between installs of the next redpanda version before starting another install and restart. (cherry picked from commit 44ebe1037ea141d79d52bd58f9da21e12d2f8f3e) --- tests/rptest/tests/control_character_flag_test.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/rptest/tests/control_character_flag_test.py b/tests/rptest/tests/control_character_flag_test.py index 98477c1f3a2a..f6bdf32ea788 100644 --- a/tests/rptest/tests/control_character_flag_test.py +++ b/tests/rptest/tests/control_character_flag_test.py @@ -45,12 +45,11 @@ def _validate_pre_upgrade(self, version): assert config.keys().isdisjoint( {self.feature_legacy_permit_control_char}) - def _perform_update(self, initial_version, version): - self._installer.install(self.redpanda.nodes, version) - self.redpanda.restart_nodes(self.redpanda.nodes) - - unique_versions = wait_for_num_versions(self.redpanda, 1) - assert ver_string(initial_version) not in unique_versions + def _perform_update(self, initial_version): + versions = self.load_version_range(initial_version)[1:] + for version in self.upgrade_through_versions(versions, + already_running=True): + self.logger.info(f"Updated to {version}") config = self._admin.get_cluster_config() assert config.keys() > {self.feature_legacy_permit_control_char} @@ -84,7 +83,7 @@ def test_upgrade_from_pre_v23_2(self, initial_version): # Creates a user with invalid control characters self._admin.create_user("my\nuser", "password", "SCRAM-SHA-256") - self._perform_update(initial_version, RedpandaInstaller.HEAD) + self._perform_update(initial_version) # Should still be able to create a user self._admin.create_user("my\notheruser", "password", "SCRAM-SHA-256") self._admin.patch_cluster_config( @@ -147,7 +146,7 @@ def test_validate_nag_message(self, initial_version): # Nag shouldn't be in logs assert not self._has_flag_nag() - self._perform_update(initial_version, RedpandaInstaller.HEAD) + self._perform_update(initial_version) assert self._has_flag_nag()