This is an automated email from the ASF dual-hosted git repository.
shahar1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 6056deb572e Remove unused CLI process test helpers (#75883)
6056deb572e is described below
commit 6056deb572e1e8fd5a51654ad0a22c963e5a6a69
Author: Hussein Awala <[email protected]>
AuthorDate: Thu Oct 29 06:18:08 2026 +0100
Remove unused CLI process test helpers (#75883)
---
.../tests/unit/cli/commands/_common_cli_classes.py | 43 ----------------------
1 file changed, 43 deletions(-)
diff --git a/airflow-core/tests/unit/cli/commands/_common_cli_classes.py
b/airflow-core/tests/unit/cli/commands/_common_cli_classes.py
index 3adfb78e699..219d6e83cf4 100644
--- a/airflow-core/tests/unit/cli/commands/_common_cli_classes.py
+++ b/airflow-core/tests/unit/cli/commands/_common_cli_classes.py
@@ -19,7 +19,6 @@ from __future__ import annotations
import os
import re
-import time
from contextlib import suppress
import psutil
@@ -93,38 +92,6 @@ class _CommonCLIUvicornTestClass:
console.print(f"[blue]Removing pidfile{pidfile_monitor}")
os.remove(pidfile_monitor)
- def _wait_pidfile(self, pidfile):
- start_time = time.monotonic()
- while True:
- try:
- with open(pidfile) as file:
- return int(file.read())
- except Exception:
- if start_time - time.monotonic() > 60:
- raise
- console.print(f"[blue]Waiting for pidfile {pidfile} to be
created ...")
- time.sleep(1)
-
- def _find_process(self, regexp_match: str, print_found_process=False) ->
int | None:
- """
- Find if process is running by matching its command line with a regexp.
- :param regexp_match: regexp to match the command line of the process
- :param print_found_process: if True, print the process found
- :return: PID of the process if found, None otherwise
- """
- matcher = re.compile(regexp_match)
- for proc in psutil.process_iter():
- try:
- proc_cmdline = " ".join(proc.cmdline())
- except Error:
- # only check processes we can access and are existing
- continue
- if matcher.search(proc_cmdline):
- if print_found_process:
- console.print(proc.as_dict(attrs=["pid", "name",
"cmdline"]))
- return proc.pid
- return None
-
def _find_all_processes(self, regexp_match: str,
print_found_process=False) -> list[int]:
"""
Find all running process matching their command line with a regexp and
return the list of pids
@@ -146,13 +113,3 @@ class _CommonCLIUvicornTestClass:
console.print(proc.as_dict(attrs=["pid", "name",
"cmdline"]))
pids.append(proc.pid)
return pids
-
- def _terminate_multiple_process(self, pid_list):
- process = []
- for pid in pid_list:
- proc = psutil.Process(pid)
- proc.terminate()
- process.append(proc)
- gone, alive = psutil.wait_procs(process, timeout=120)
- for p in alive:
- p.kill()