ColtenOuO opened a new pull request, #72548: URL: https://github.com/apache/airflow/pull/72548
### Sumarry `airflow connections test <conn_id>` prints "Connection failed!" but always returns exit code 0, because the failure branch in `connections_test` (`airflow-core/src/airflow/cli/commands/connection_command.py`) only prints the error message without raising `SystemExit(1)`. The other two failure paths in the same function (test-connection disabled, connection not found) already `raise SystemExit(1)`, so this was an inconsistency rather than intentional behavior. Any script that runs this command and checks `$?` (e.g. a deployment pre-flight check or a custom health check a deployment team wrote around this CLI) will treat a failed connection test as a success. ### Change This PR adds `raise SystemExit(1)` to the failure branch and updates `test_cli_connections_test_fail` to assert the exit code. -- 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]
