Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions tests/integration/ha_tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import logging

import pytest
from juju import tag
from pytest_operator.plugin import OpsTest
from tenacity import Retrying, stop_after_delay, wait_fixed

Expand Down Expand Up @@ -143,7 +142,6 @@ async def test_charm_garbage_ignorance(ops_test: OpsTest, charm: str):


@pytest.mark.abort_on_fail
@pytest.mark.skip(reason="Unstable")
async def test_app_resources_conflicts_v3(ops_test: OpsTest, charm: str):
"""Test application deploy in dirty environment with garbage storage from another application."""
async with ops_test.fast_forward():
Expand All @@ -156,14 +154,17 @@ async def test_app_resources_conflicts_v3(ops_test: OpsTest, charm: str):
logger.info(f"Collected storages: {garbage_storages}")

logger.info("deploying duplicate application with attached storage")
await ops_test.model.deploy(
charm,
application_name=DUP_DATABASE_APP_NAME,
num_units=1,
base=CHARM_BASE,
attach_storage=[tag.storage(storage) for storage in garbage_storages],
config={"profile": "testing"},
)
deploy_cmd = [
"deploy",
f"./{charm}",
DUP_DATABASE_APP_NAME,
"--model={ops_test.model.info.name}",
"--config profile=testing",
f"--attach-storage={','.join(garbage_storages)}",
]
logger.info(deploy_cmd)
return_code, _, _ = await ops_test.juju(*deploy_cmd)
assert return_code == 0, "Failed to add unit with storage"

# Reducing the update status frequency to speed up the triggering of deferred events.
await ops_test.model.set_config({"update-status-hook-interval": "10s"})
Expand Down
7 changes: 4 additions & 3 deletions tests/integration/test_subordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,26 @@ async def test_deploy(ops_test: OpsTest, charm: str, check_subordinate_env_vars)
)

await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", timeout=2000)
await ops_test.model.relate(f"{DATABASE_APP_NAME}:juju-info", f"{LS_CLIENT}:container")
await ops_test.model.relate(
f"{DATABASE_APP_NAME}:juju-info", f"{UBUNTU_PRO_APP_NAME}:juju-info"
)
await ops_test.model.wait_for_idle(
apps=[UBUNTU_PRO_APP_NAME, DATABASE_APP_NAME], status="active"
apps=[LS_CLIENT, UBUNTU_PRO_APP_NAME, DATABASE_APP_NAME], status="active"
)


async def test_scale_up(ops_test: OpsTest, check_subordinate_env_vars):
await scale_application(ops_test, DATABASE_APP_NAME, 4)

await ops_test.model.wait_for_idle(
apps=[UBUNTU_PRO_APP_NAME, DATABASE_APP_NAME], status="active", timeout=1500
apps=[LS_CLIENT, UBUNTU_PRO_APP_NAME, DATABASE_APP_NAME], status="active", timeout=1500
)


async def test_scale_down(ops_test: OpsTest, check_subordinate_env_vars):
await scale_application(ops_test, DATABASE_APP_NAME, 3)

await ops_test.model.wait_for_idle(
apps=[UBUNTU_PRO_APP_NAME, DATABASE_APP_NAME], status="active", timeout=1500
apps=[LS_CLIENT, UBUNTU_PRO_APP_NAME, DATABASE_APP_NAME], status="active", timeout=1500
)
Loading