@@ -624,7 +624,7 @@ async def test_deploy_zero_units(ops_test: OpsTest, charm):
624
624
logger .info ("check test database data" )
625
625
await validate_test_data (connection_string )
626
626
627
- logger .info ("scaling database to tow unit using foreign cluster" )
627
+ logger .info ("database scaling up to two units using third-party cluster storage " )
628
628
new_unit = await add_unit_with_storage (ops_test , app = app , storage = second_storage , is_blocked = True )
629
629
630
630
logger .info (f"remove unit { new_unit .name } with storage from application { SECOND_APPLICATION } " )
@@ -635,34 +635,34 @@ async def test_deploy_zero_units(ops_test: OpsTest, charm):
635
635
logger .info ("check test database data" )
636
636
await validate_test_data (connection_string )
637
637
638
- # # Scale up to two units.
639
- # logger.info("scaling database to two unit")
640
- # prev_units = [unit.name for unit in ops_test.model.applications[app].units]
641
- # await scale_application(ops_test, application_name=app, count=2)
642
- # unit = await get_last_added_unit(ops_test, app, prev_units)
643
- #
644
- # logger.info(f"check test database data of unit name {unit.name}")
645
- # connection_string, _ = await get_db_connection(
646
- # ops_test, dbname=dbname, is_primary=False, replica_unit_name=unit.name
647
- # )
648
- # await validate_test_data(connection_string)
649
- # assert await reused_replica_storage(
650
- # ops_test, unit_name=unit.name
651
- # ), "attached storage not properly re-used by Postgresql."
652
- #
653
- # # Scale up to three units.
654
- # logger.info("scaling database to three unit")
655
- # prev_units = [unit.name for unit in ops_test.model.applications[app].units]
656
- # await scale_application(ops_test, application_name=app, count=3)
657
- # unit = await get_last_added_unit(ops_test, app, prev_units)
658
- #
659
- # logger.info(f"check test database data of unit name {unit.name}")
660
- # connection_string, _ = await get_db_connection(
661
- # ops_test, dbname=dbname, is_primary=False, replica_unit_name=unit.name
662
- # )
663
- # await validate_test_data(connection_string)
664
- # assert await reused_replica_storage(
665
- # ops_test, unit_name=unit.name
666
- # ), "attached storage not properly re-used by Postgresql."
667
- #
668
- # await check_writes(ops_test)
638
+ # Scale up to two units.
639
+ logger .info ("scaling database to two unit" )
640
+ prev_units = [unit .name for unit in ops_test .model .applications [app ].units ]
641
+ await scale_application (ops_test , application_name = app , count = 2 )
642
+ unit = await get_last_added_unit (ops_test , app , prev_units )
643
+
644
+ logger .info (f"check test database data of unit name { unit .name } " )
645
+ connection_string , _ = await get_db_connection (
646
+ ops_test , dbname = dbname , is_primary = False , replica_unit_name = unit .name
647
+ )
648
+ await validate_test_data (connection_string )
649
+ assert await reused_replica_storage (
650
+ ops_test , unit_name = unit .name
651
+ ), "attached storage not properly re-used by Postgresql."
652
+
653
+ # Scale up to three units.
654
+ logger .info ("scaling database to three unit" )
655
+ prev_units = [unit .name for unit in ops_test .model .applications [app ].units ]
656
+ await scale_application (ops_test , application_name = app , count = 3 )
657
+ unit = await get_last_added_unit (ops_test , app , prev_units )
658
+
659
+ logger .info (f"check test database data of unit name { unit .name } " )
660
+ connection_string , _ = await get_db_connection (
661
+ ops_test , dbname = dbname , is_primary = False , replica_unit_name = unit .name
662
+ )
663
+ await validate_test_data (connection_string )
664
+ assert await reused_replica_storage (
665
+ ops_test , unit_name = unit .name
666
+ ), "attached storage not properly re-used by Postgresql."
667
+
668
+ await check_writes (ops_test )
0 commit comments