You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ashb (via GitHub)" <gi...@apache.org> on 2023/05/04 13:48:33 UTC
[GitHub] [airflow] ashb commented on a diff in pull request #31061: Fix issue in pre-importing modules in zipfile
ashb commented on code in PR #31061:
URL: https://github.com/apache/airflow/pull/31061#discussion_r1185045941
##########
tests/dag_processing/test_processor.py:
##########
@@ -917,6 +917,22 @@ def test_dag_parser_output_when_logging_to_file(self, mock_redirect_stdout_for_f
)
mock_redirect_stdout_for_file.assert_called_once()
+ @mock.patch("airflow.dag_processing.processor.settings.dispose_orm", MagicMock)
+ def test_no_valueerror_with_parseable_dag_in_zip(self, tmpdir):
+ zip_filename = os.path.join(tmpdir, "test_zip.zip")
+ with ZipFile(zip_filename, "w") as zip_file:
+ zip_file.writestr(TEMP_DAG_FILENAME, PARSEABLE_DAG_FILE_CONTENTS)
+
+ processor = DagFileProcessorProcess(
+ file_path=zip_filename,
+ pickle_dags=False,
+ dag_ids=[],
+ dag_directory=[],
+ callback_requests=[],
+ )
+ processor.start()
+ processor.terminate()
Review Comment:
This will send a SIGTERM to the processor -- meaning it might not actually test what we want. I think we need to let it run to completion.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org