diff --git a/tests/integration/ha_tests/test_async_replication.py b/tests/integration/ha_tests/test_async_replication.py index 5f0c27dea8..bbb1991c7f 100644 --- a/tests/integration/ha_tests/test_async_replication.py +++ b/tests/integration/ha_tests/test_async_replication.py @@ -3,6 +3,7 @@ # See LICENSE file for licensing details. import contextlib import logging +import subprocess from asyncio import gather from typing import Optional @@ -12,7 +13,7 @@ from pytest_operator.plugin import OpsTest from tenacity import Retrying, stop_after_delay, wait_fixed -from .. import markers +from .. import architecture, markers from ..helpers import ( APPLICATION_NAME, DATABASE_APP_NAME, @@ -70,6 +71,10 @@ async def second_model(ops_test: OpsTest, first_model, request) -> Model: second_model_name = f"{first_model.info.name}-other" if second_model_name not in await ops_test._controller.list_models(): await ops_test._controller.add_model(second_model_name) + subprocess.run(["juju", "switch", second_model_name], check=True) + subprocess.run( + ["juju", "set-model-constraints", f"arch={architecture.architecture}"], check=True + ) second_model = Model() await second_model.connect(model_name=second_model_name) yield second_model