pingzh commented on a change in pull request #11875:
URL: https://github.com/apache/airflow/pull/11875#discussion_r512880535
##########
File path: tests/utils/test_dag_processing.py
##########
@@ -138,6 +138,29 @@ def test_max_runs_when_no_files(self):
child_pipe.close()
parent_pipe.close()
+ def test_start_new_processes_with_files_to_exclude(self):
+ processor_factory = MagicMock()
+ manager = DagFileProcessorManager(
+ dag_directory='directory',
+ max_runs=1,
+ processor_factory=processor_factory,
+ processor_timeout=timedelta.max,
+ signal_conn=MagicMock(),
+ dag_ids=[],
+ pickle_dags=False,
+ async_mode=True)
+ f1 = '/tmp/f1.py'
+ f2 = '/tmp/f2.py'
+ manager._file_path_queue = [f1, f2]
+ files_paths_to_exclude_in_this_loop = {f1}
+
+ manager.start_new_processes(files_paths_to_exclude_in_this_loop)
Review comment:
i chose to have `files_paths_to_exclude_in_this_loop` inside the
`start_new_processes` as i was thinking that is single place we do a `pop(0)`
and start new process, so adding a check will guarantee it won't double process
dag files.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]