class_docstr: Launch Airflow scheduler in the context.
class_docstr_tok: ["Launch","Airflow","scheduler","in","the","context","."]
code: def __enter__(self):
      self._sub_process = subprocess.Popen(self._args)
      while True:
          time.sleep(10)
          check_result = (
              subprocess.run(  # pylint: disable=subprocess-run-check
                  [
                      "airflow",
                      "jobs",
                      "check",
                      "--job-type",
                      "SchedulerJob",
                  ]
              )
          )
          if check_result.returncode == 0:
              time.sleep(
                  10
              )  # Wait for a bit more until dag processing is completed.
              break
      return self
  
file_path: tfx/tfx/orchestration/airflow/test_utils.py
imports: import subprocess
  import time
  from typing import Tuple
  from absl import logging
  import docker
label_desc: Use image node_id 2 for calling the AirflowScheduler obj's underlying member method code with example usage: obj.__enter__() and returns: self