From 98fcae3ff39b0f16b0e48e6e8cbe2a9c3871377b Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Fri, 29 Nov 2024 14:45:09 +0200 Subject: [PATCH] Tactical sleep --- tests/integration/ha_tests/helpers.py | 4 ++-- tests/integration/ha_tests/test_replication.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/integration/ha_tests/helpers.py b/tests/integration/ha_tests/helpers.py index d24b2b589e..57ddac6dd9 100644 --- a/tests/integration/ha_tests/helpers.py +++ b/tests/integration/ha_tests/helpers.py @@ -100,7 +100,7 @@ async def are_writes_increasing( use_ip_from_inside=use_ip_from_inside, extra_model=extra_model, ) - # logger.info(f"Initial writes {writes}") + logger.info(f"Initial writes {writes}") for attempt in Retrying(stop=stop_after_delay(60 * 3), wait=wait_fixed(3), reraise=True): with attempt: @@ -110,7 +110,7 @@ async def are_writes_increasing( use_ip_from_inside=use_ip_from_inside, extra_model=extra_model, ) - # logger.info(f"Retry writes {more_writes}") + logger.info(f"Retry writes {more_writes}") for member, count in writes.items(): if "/".join(member.split(".", 1)[-1].rsplit("-", 1)) in down_units: continue diff --git a/tests/integration/ha_tests/test_replication.py b/tests/integration/ha_tests/test_replication.py index d85f3901a1..a42bf4c86c 100644 --- a/tests/integration/ha_tests/test_replication.py +++ b/tests/integration/ha_tests/test_replication.py @@ -2,6 +2,8 @@ # Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. +import time + import pytest from pytest_operator.plugin import OpsTest from tenacity import Retrying, stop_after_delay, wait_fixed @@ -69,6 +71,8 @@ async def test_reelection(ops_test: OpsTest, continuous_writes, primary_start_ti async with ops_test.fast_forward(): await ops_test.model.wait_for_idle(apps=[app], status="active") + time.sleep(30) + await are_writes_increasing(ops_test, primary_name) # Verify that a new primary gets elected (ie old primary is secondary).