def test_kill_timed_out_processors_kill(self, mock_kill, mock_pid): mock_pid.return_value = 1234 manager = DagFileProcessorManager( dag_directory='directory', file_paths=['abc.txt'], max_runs=1, processor_factory=MagicMock().return_value, processor_timeout=timedelta(seconds=5), signal_conn=MagicMock(), async_mode=True) processor = DagFileProcessor('abc.txt', False, []) processor._start_time = timezone.make_aware(datetime.min) manager._processors = {'abc.txt': processor} manager._kill_timed_out_processors() mock_kill.assert_called_once_with()
def processor_factory(file_path): return DagFileProcessor(file_path, False, [])
def processor_factory(file_path, zombies): return DagFileProcessor(file_path, False, [], zombies)
def _processor_factory(file_path, zombies, dag_ids, pickle_dags): return DagFileProcessor(file_path, pickle_dags, dag_ids, zombies)