This tests fails occasionally on mysql at least:

https://github.com/apache/airflow/pull/11555/checks?check_run_id=1260840314#step:9:1125

```
=================================== FAILURES ===================================
_____________ TestSchedulerJob.test_no_orphan_process_will_be_left _____________

self = <tests.jobs.test_scheduler_job.TestSchedulerJob testMethod=test_no_orphan_process_will_be_left>

    def test_no_orphan_process_will_be_left(self):
        empty_dir = mkdtemp()
        current_process = psutil.Process()
        old_children = current_process.children(recursive=True)
        scheduler = SchedulerJob(subdir=empty_dir,
                                 num_runs=1,
                                 executor=MockExecutor(do_update=False))
        scheduler.run()
        shutil.rmtree(empty_dir)
    
        # Remove potential noise created by previous tests.
        current_children = set(current_process.children(recursive=True)) - set(
            old_children)
>       self.assertFalse(current_children)
E       AssertionError: {psutil.Process(pid=3474, name='/usr/local/bin/', status='running', started='19:26:22')} is not false

tests/jobs/test_scheduler_job.py:871: AssertionError
```



tests/models/test_taskinstance.py
task_b = PythonOperator(task_id='B', python_callable=python_callable)
                task_c = PythonOperator(task_id='C', python_callable=python_callable)
                if 'D' in init_state:
                    task_d = PythonOperator(task_id='D', python_callable=python_callable)
                for upstream, downstream in dependencies.items():
                    dag.set_dependency(upstream, downstream)
            scheduler = SchedulerJob(subdir=os.devnull)
            scheduler.dagbag.bag_dag(dag, root_dag=dag)
            dag_run = dag.create_dagrun(run_id='test_dagrun_fast_follow', state=State.RUNNING)
            task_instance_a = dag_run.get_task_instance(task_id=task_a.task_id)
            task_instance_a.task = task_a
            task_instance_a.set_state(init_state['A'])
            task_instance_b = dag_run.get_task_instance(task_id=task_b.task_id)
            task_instance_b.task = task_b
            task_instance_b.set_state(init_state['B'])
            task_instance_c = dag_run.get_task_instance(task_id=task_c.task_id)
            task_instance_c.task = task_c
            task_instance_c.set_state(init_state['C'])
            if 'D' in init_state:
                task_instance_d = dag_run.get_task_instance(task_id=task_d.task_id)
                task_instance_d.task = task_d
                task_instance_d.state = init_state['D']
            session.commit()
            task_instance_a.run()
            self.validate_ti_states(dag_run, first_run_state, error_message)
            if second_run_state:
                scheduler._critical_section_execute_task_instances(session=session)
                task_instance_b.run()
                self.validate_ti_states(dag_run, second_run_state, error_message)
    def test_set_state_up_for_retry(self):