code: def test_run_job_exception_handling(
      self,
      mock_log,
      mock_run_job,
      mock_process,
      mock_scheduler_job,
  ):
      args = self.parser.parse_args(["scheduler"])
      with pytest.raises(Exception, match="run_job failed"):
          scheduler_command.scheduler(args)
  
      # Make sure that run_job is called, that the exception has been logged, and that the serve_logs
      # sub-process has been terminated
      mock_run_job.assert_called_once_with(
          job=mock_scheduler_job().job,
          execute_callable=mock_scheduler_job()._execute,
      )
      mock_log.exception.assert_called_once_with(
          "Exception when running scheduler job"
      )
      mock_process.assert_called_once_with(target=serve_logs)
      mock_process().terminate.assert_called_once_with()
  
imports: from __future__ import annotations
  from http.server import BaseHTTPRequestHandler
  from unittest import mock
  from unittest.mock import MagicMock
  import pytest
  from airflow.cli import cli_parser
  from airflow.cli.commands import scheduler_command
  from airflow.utils.scheduler_health import HealthServer, serve_health_check
  from airflow.utils.serve_logs import serve_logs
  from tests.test_utils.config import conf_vars
label_desc: Use image node_id 10 for calling the TestSchedulerCommand obj's underlying member method code with example usage: obj.test_run_job_exception_handling(mock_log, mock_run_job, mock_process, mock_scheduler_job) without return types