From 662f2357363da76075d716c86f5a78fddf1e3d7b Mon Sep 17 00:00:00 2001 From: Vladyslav Tarasenko Date: Wed, 19 Jun 2024 05:49:00 +0300 Subject: [PATCH] Fix backups integration test. --- tests/integration/test_backups.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/tests/integration/test_backups.py b/tests/integration/test_backups.py index 8e25f23a8d..3f68bc8463 100644 --- a/tests/integration/test_backups.py +++ b/tests/integration/test_backups.py @@ -59,15 +59,9 @@ async def cloud_configs(ops_test: OpsTest, github_secrets) -> None: configs = { AWS: { "endpoint": "https://s3.amazonaws.com", - "bucket": "data-charms-testing", - "path": f"/postgresql-vm/{uuid.uuid1()}", - "region": "us-east-1", - }, - GCP: { - "endpoint": "https://storage.googleapis.com", - "bucket": "data-charms-testing", - "path": f"/postgresql-vm/{uuid.uuid1()}", - "region": "", + "bucket": "v-tarasenko", + "path": f"/pytest-vm/{uuid.uuid1()}", + "region": "eu-central-1", }, } credentials = { @@ -75,10 +69,6 @@ async def cloud_configs(ops_test: OpsTest, github_secrets) -> None: "access-key": github_secrets["AWS_ACCESS_KEY"], "secret-key": github_secrets["AWS_SECRET_KEY"], }, - GCP: { - "access-key": github_secrets["GCP_ACCESS_KEY"], - "secret-key": github_secrets["GCP_SECRET_KEY"], - }, } yield configs, credentials # Delete the previously created objects. @@ -229,7 +219,11 @@ async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict], charm # Wait for the restore to complete. async with ops_test.fast_forward(): - await ops_test.model.wait_for_idle(status="active", timeout=1000) + await ops_test.model.block_until( + lambda: remaining_unit.workload_status_message + == MOVE_RESTORED_CLUSTER_TO_ANOTHER_BUCKET, + timeout=1000, + ) # Check that the backup was correctly restored by having only the first created table. logger.info("checking that the backup was correctly restored")