Skip to content

Commit

Permalink
Merge pull request #21477 from vbotbuildovich/backport-pr-21428-v24.1…
Browse files Browse the repository at this point in the history
….x-713

[v24.1.x] tests/controller_snapshot: fix no-op controller leadership transfers
  • Loading branch information
ztlpn authored Jul 17, 2024
2 parents 9827124 + 388ba06 commit 4ce043f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/rptest/services/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@ def is_leader_stable():
backoff_s=backoff_s)
if check(info.leader):
return True, info.leader

self.redpanda.logger.debug(
f"check failed (leader id: {info.leader})")
return False

return wait_until_result(
Expand Down
7 changes: 7 additions & 0 deletions tests/rptest/tests/controller_snapshot_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,13 @@ def check(node, expected):
for iter in range(5):
self.redpanda.stop_node(joiner)

# wait for the joiner to step down in case it was the controller
joiner_id = self.redpanda.node_id(joiner)
admin.await_stable_leader(namespace='redpanda',
topic='controller',
check=lambda id: id != joiner_id,
timeout_s=30)

executed = 0
to_execute = random.randint(1, 5)
while executed < to_execute:
Expand Down

0 comments on commit 4ce043f

Please sign in to comment.