Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion opensearch_single_kernel/workload/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def is_service_started(self, paused: bool | None = False) -> bool:
# Now, we must dig deeper into the actual status of systemd and the JVM process.
# First, we want to make sure the process is not stopped, dead or zombie.
try:
pid = self.run_cmd("lsof", args="-ti:9200").out.rstrip()
pid = self.run_cmd("lsof", args="-ti:9200 -sTCP:LISTEN").out.rstrip()
if not pid or not os.path.exists(f"/proc/{pid}/stat"):
return False
with open(f"/proc/{pid}/stat") as f:
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/ha/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ async def all_processes_down(ops_test: OpsTest, app: str) -> bool:
"""Check if all processes are down."""
for unit_id in get_application_unit_ids(ops_test, app):
unit_name = f"{app}/{unit_id}"
get_pid_cmd = f"ssh {unit_name} -- sudo lsof -ti:9200"
get_pid_cmd = f"ssh {unit_name} -- sudo lsof -ti:9200 -sTCP:LISTEN"
try:
for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3)):
with attempt:
Expand All @@ -337,9 +337,9 @@ async def send_kill_signal_to_process(

if opensearch_pid is None:
if substrate == "vm":
get_pid_cmd = f"ssh {unit_name} -- sudo lsof -ti:9200"
get_pid_cmd = f"ssh {unit_name} -- sudo lsof -ti:9200 -sTCP:LISTEN"
else:
get_pid_cmd = f"ssh --container opensearch {unit_name} lsof -ti:9200"
get_pid_cmd = f"ssh --container opensearch {unit_name} lsof -ti:9200 -sTCP:LISTEN"
_, opensearch_pid, _ = await ops_test.juju(
*get_pid_cmd.split(), check=False, stdin=NO_TTY_STDIN
)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/ha/k8s_helpers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def pebble_patch_restart_delay(
for attempt in Retrying(stop=stop_after_delay(120), wait=wait_fixed(3)):
with attempt:
result = subprocess.run(
f"juju ssh --container opensearch {unit_name} lsof -ti:9200".split(),
f"juju ssh --container opensearch {unit_name} lsof -ti:9200 -sTCP:LISTEN".split(),
capture_output=True,
text=True,
stdin=subprocess.DEVNULL,
Expand Down
Loading