Skip to content

Commit 05b40eb

Browse files
committed
handle error: storage belongs to different cluster
1 parent 936c828 commit 05b40eb

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/integration/ha_tests/test_self_healing.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
8080
async with ops_test.fast_forward():
8181
await ops_test.model.deploy(
8282
charm,
83-
num_units=3,
83+
num_units=1,
8484
series=CHARM_SERIES,
8585
storage={"pgdata": {"pool": "lxd-btrfs", "size": 2048}},
8686
config={"profile": "testing"},
@@ -617,14 +617,19 @@ async def test_deploy_zero_units(ops_test: OpsTest, charm):
617617
await add_unit_with_storage(ops_test, app=app, storage=primary_storage)
618618
await ops_test.model.wait_for_idle(apps=[APP_NAME, APPLICATION_NAME], status="active", timeout=1500)
619619

620+
connection_string, _ = await get_db_connection(ops_test, dbname=dbname)
621+
logger.info("checking whether writes are increasing")
622+
await are_writes_increasing(ops_test)
623+
624+
logger.info("check test database data")
625+
await validate_test_data(connection_string)
626+
620627
logger.info("scaling database to tow unit using foreign cluster")
621628
new_unit = await add_unit_with_storage(ops_test, app=app, storage=second_storage, is_blocked=True)
622629

623630
logger.info(f"remove unit {new_unit.name} with storage from application {SECOND_APPLICATION}")
624631
await ops_test.model.destroy_units(new_unit.name)
625632

626-
connection_string, _ = await get_db_connection(ops_test, dbname=dbname)
627-
logger.info("checking whether writes are increasing")
628633
await are_writes_increasing(ops_test)
629634

630635
logger.info("check test database data")

0 commit comments

Comments
 (0)