Skip to content

Commit 36a6ca1

Browse files
authored
Wait longer in committable_suffix_test (#1679)
1 parent 4c36db9 commit 36a6ca1

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

tests/committable.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def run(args):
3737
primary.stop()
3838
backups[1].resume()
3939
backups[2].resume()
40-
new_primary, new_term = network.wait_for_new_primary(primary.node_id)
40+
new_primary, new_term = network.wait_for_new_primary(
41+
primary.node_id, timeout_multiplier=6
42+
)
4143
LOG.debug(f"New primary is {new_primary.node_id} in term {new_term}")
4244
assert new_primary.node_id == backups[0].node_id
4345

tests/infra/network.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,10 +689,10 @@ def wait_for_node_commit_sync(self, consensus, timeout=3):
689689
expected = [commits[0]] * len(commits)
690690
assert expected == commits, f"{commits} != {expected}"
691691

692-
def wait_for_new_primary(self, old_primary_id):
692+
def wait_for_new_primary(self, old_primary_id, timeout_multiplier=2):
693693
# We arbitrarily pick twice the election duration to protect ourselves against the somewhat
694694
# but not that rare cases when the first round of election fails (short timeout are particularly susceptible to this)
695-
timeout = self.election_duration * 2
695+
timeout = self.election_duration * timeout_multiplier
696696
LOG.info(
697697
f"Waiting up to {timeout}s for a new primary (different from {old_primary_id}) to be elected..."
698698
)

0 commit comments

Comments
 (0)