Skip to content

Commit

Permalink
Functional Testing. Recovery testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
BON4 committed Jun 6, 2024
1 parent d632b43 commit 6deb1d2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
11 changes: 11 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/integration/ha_tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ async def check_graceful_shutdown(ops_test: OpsTest, unit_name: str) -> bool:
stdout = await run_command_on_unit(
ops_test,
unit_name,
f'cat /var/snap/charmed-postgresql/common/var/log/postgresql/postgresql*',
"cat /var/snap/charmed-postgresql/common/var/log/postgresql/postgresql*",
)

return log_str in str(stdout)
Expand Down
9 changes: 7 additions & 2 deletions tests/integration/ha_tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ async def test_instance_forceful_restart(ops_test: OpsTest, charm: str) -> None:
with attempt:
await ops_test.model.remove_application(APPLICATION_NAME, block_until_done=True)


@pytest.mark.group(1)
@pytest.mark.abort_on_fail
async def test_instance_backup_with_restart(
Expand Down Expand Up @@ -279,6 +280,10 @@ async def test_instance_backup_with_restart(
assert not await check_db(ops_test, DATABASE_APP_NAME, TEST_DATABASE_NAME + "_dup")

logger.info("remove application")
for attempt in Retrying(stop=stop_after_delay(15 * 3), wait=wait_fixed(3), reraise=True):
for attempt in Retrying(
stop=stop_after_delay(15 * 3), wait=wait_fixed(3), reraise=True
):
with attempt:
await ops_test.model.remove_application(DATABASE_APP_NAME, block_until_done=True)
await ops_test.model.remove_application(
DATABASE_APP_NAME, block_until_done=True
)

0 comments on commit 6deb1d2

Please sign in to comment.