Skip to content

Commit

Permalink
Fix change WAL settings fixture (#62)
Browse files Browse the repository at this point in the history
* Fix error that is raised when calling change WAL settings

* Remove unused import

* Add reformatted file
  • Loading branch information
marceloneppel authored Feb 10, 2023
1 parent 3f09edc commit 85bbe8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tests/integration/ha_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
get_postgresql_parameter,
update_restart_delay,
)
from tests.integration.helpers import run_command_on_unit

APPLICATION_NAME = "application"

Expand Down Expand Up @@ -63,9 +64,12 @@ async def wal_settings(ops_test: OpsTest) -> None:
initial_min_wal_size = await get_postgresql_parameter(ops_test, "min_wal_size")
initial_wal_keep_segments = await get_postgresql_parameter(ops_test, "wal_keep_segments")
yield
# Rollback to the initial settings.
app = await app_name(ops_test)
for unit in ops_test.model.applications[app].units:
# Start Patroni if it was previously stopped.
await run_command_on_unit(ops_test, unit.name, "systemctl start patroni")

# Rollback to the initial settings.
await change_wal_settings(
ops_test,
unit.name,
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ def test_on_start_no_patroni_member(
patroni,
_postgresql,
):

# Mock the passwords.
patroni.return_value.member_started = False
_get_password.return_value = "fake-operator-password"
Expand Down

0 comments on commit 85bbe8b

Please sign in to comment.