Skip to content

Commit

Permalink
rptest: Fix for failing upgrade test
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Rob Blafford committed May 28, 2024
1 parent d8f01f3 commit 44ebe10
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tests/rptest/tests/control_character_flag_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
for v in self.load_version_range(initial_version):
self._installer.install(self.redpanda.nodes, v)
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}
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 44ebe10

Please sign in to comment.