Skip to content

Commit

Permalink
re-add after being lost in rebasing: make continuous writes reusable …
Browse files Browse the repository at this point in the history
…if tests are run on an already existing etcd application
  • Loading branch information
reneradoi committed Jan 8, 2025
1 parent 61f6003 commit 9dd0f25
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/integration/ha/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ async def existing_app(ops_test: OpsTest) -> str | None:
return list(etcd_apps.keys())[0] if etcd_apps else None


def start_continuous_writes(ops_test: OpsTest, endpoints: str, user: str, password: str) -> None:
def start_continuous_writes(ops_test: OpsTest, app_name: str, endpoints: str, user: str, password: str) -> None:
model = ops_test.model_full_name
# this is the unit where the `etcdctl` command is executed
# it does not mean that data is written to this cluster member
# before removing the unit used for running `etcdctl`, continuous writes should be stopped
unit = ops_test.model.applications[APP_NAME].units[0].name
unit = ops_test.model.applications[app_name].units[0].name
subprocess.Popen(
[
"python3",
Expand All @@ -52,9 +52,9 @@ def stop_continuous_writes() -> None:
proc.communicate()


def count_writes(ops_test: OpsTest, endpoints: str, user: str, password: str) -> str:
def count_writes(ops_test: OpsTest, app_name: str, endpoints: str, user: str, password: str) -> str:
model = ops_test.model_full_name
unit = ops_test.model.applications[APP_NAME].units[0].name
unit = ops_test.model.applications[app_name].units[0].name
key = "cw_key"

etcd_command = f"""{SNAP_NAME}.etcdctl \
Expand Down

0 comments on commit 9dd0f25

Please sign in to comment.