Skip to content

Commit

Permalink
Merge pull request #11457 from mmaslankaprv/wait-for-controller
Browse files Browse the repository at this point in the history
tests: wait for controller to be elected when deciding which node to use
  • Loading branch information
mmaslankaprv authored Jun 16, 2023
2 parents e13a04d + 3de6615 commit 992c1fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/rptest/tests/controller_erase_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from rptest.clients.types import TopicSpec
from ducktape.mark import parametrize
from ducktape.utils.util import wait_until
from rptest.util import wait_until_result

ERASE_ERROR_MSG = "Inconsistency detected between KVStore last_applied"
ERASE_LOG_ALLOW_LIST = RESTART_LOG_ALLOW_LIST + [ERASE_ERROR_MSG]
Expand Down Expand Up @@ -57,7 +58,14 @@ def test_erase_controller_log(self, partial):

# Stop the node we will intentionally damage
victim_node = self.redpanda.nodes[1]
bystander_node = self.redpanda.controller()

def controller_elected():
ctrl = self.redpanda.controller()
return (ctrl is not None, ctrl)

bystander_node = wait_until_result(controller_elected,
timeout_sec=15,
backoff_sec=1)

def wait_all_segments():
storage = self.redpanda.node_storage(victim_node)
Expand Down

0 comments on commit 992c1fc

Please sign in to comment.