Skip to content

Commit

Permalink
Stop continuous writes
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomirp committed Jul 30, 2024
1 parent 5587e34 commit 868b645
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions tests/integration/helpers/ha_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,8 @@ async def start_continuous_writes(
assert action.results["result"] == "True", "Unable to create continuous_writes table"


async def stop_continuous_writes(ops_test: OpsTest) -> int:
async def stop_continuous_writes(ops_test: OpsTest, test_app: str = CLIENT_APP_NAME) -> int:
"""Stops continuous writes to PostgreSQL and returns the last written value."""
action = await ops_test.model.units.get(f"{CLIENT_APP_NAME}/0").run_action(
"stop-continuous-writes"
)
action = await ops_test.model.units.get(f"{test_app}/0").run_action("stop-continuous-writes")
action = await action.wait()
return int(action.results["writes"])
2 changes: 1 addition & 1 deletion tests/integration/test_node_port.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ async def test_node_port_and_clusterip_setup(ops_test: OpsTest):
endpoint = await get_endpoint_info(ops_test, f"{app}/0", "database")
assert "svc.cluster.local" in endpoint

await stop_continuous_writes(ops_test)
await stop_continuous_writes(ops_test, test_app=SECOND_CLIENT_APP_NAME)


@pytest.mark.group(1)
Expand Down

0 comments on commit 868b645

Please sign in to comment.