mik-laj commented on code in PR #23905:
URL: https://github.com/apache/airflow/pull/23905#discussion_r889520334
##########
tests/cli/commands/test_scheduler_command.py:
##########
@@ -87,3 +90,14 @@ def test_graceful_shutdown(self, executor, mock_process,
mock_scheduler_job):
scheduler_command.scheduler(args)
finally:
mock_process().terminate.assert_called()
+
+ @mock.patch("airflow.cli.commands.scheduler_command.SchedulerJob")
+ @mock.patch("airflow.cli.commands.scheduler_command.Process")
+ def test_serve_scheduler_health(
+ self,
+ mock_process,
+ mock_scheduler_job,
+ ):
+ args = self.parser.parse_args(['scheduler'])
+ scheduler_command.scheduler(args)
+ mock_process.assert_has_calls([mock.call(target=serve_health_check)])
Review Comment:
Can you add a test that will assert two response codes explicitly - `200`,
`504`?
```python
self.assertEqual(504, response.status_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]