potiuk commented on code in PR #44802:
URL: https://github.com/apache/airflow/pull/44802#discussion_r1877995732
##########
dev/breeze/src/airflow_breeze/commands/testing_commands.py:
##########
@@ -1118,8 +1118,19 @@ def python_api_client_tests(
@contextlib.contextmanager
def run_with_timeout(timeout: int):
def timeout_handler(signum, frame):
- get_console().print("[error]Timeout reached. Killing the process[/]")
- sys.exit(1)
+ get_console().print("[error]Timeout reached. Killing the
container(s)[/]")
+ list_of_containers = run_command(
+ ["docker", "ps", "-q"],
+ check=True,
+ capture_output=True,
+ text=True,
+ )
+ run_command(
+ ["docker", "kill", "--signal", "SIGQUIT"] +
list_of_containers.stdout.splitlines(),
+ check=True,
+ capture_output=True,
Review Comment:
One more thing here - we do not need to capture output here, it's actually
best to see what's going on when we docker kill command,
```suggestion
capture_output=False,
```
##########
dev/breeze/src/airflow_breeze/commands/testing_commands.py:
##########
@@ -1118,8 +1118,19 @@ def python_api_client_tests(
@contextlib.contextmanager
def run_with_timeout(timeout: int):
def timeout_handler(signum, frame):
- get_console().print("[error]Timeout reached. Killing the process[/]")
- sys.exit(1)
+ get_console().print("[error]Timeout reached. Killing the
container(s)[/]")
+ list_of_containers = run_command(
+ ["docker", "ps", "-q"],
+ check=True,
+ capture_output=True,
+ text=True,
+ )
+ run_command(
+ ["docker", "kill", "--signal", "SIGQUIT"] +
list_of_containers.stdout.splitlines(),
+ check=True,
+ capture_output=True,
Review Comment:
One more thing here - we do not need to capture output here, it's actually
best to see what's going on when we run docker kill command,
```suggestion
capture_output=False,
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]