You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Taragolis (via GitHub)" <gi...@apache.org> on 2023/09/02 15:38:04 UTC
[GitHub] [airflow] Taragolis commented on a diff in pull request #34037: Fix issue with unit tests in subprocesses on macOS
Taragolis commented on code in PR #34037:
URL: https://github.com/apache/airflow/pull/34037#discussion_r1313874658
##########
airflow/config_templates/unit_tests.cfg:
##########
@@ -59,6 +59,8 @@ unit_test_mode = True
killed_task_cleanup_time = 5
# We only allow our own classes to be deserialized in tests
allowed_deserialization_classes = airflow\..* tests\..*
+# mocks from unittest.mock work correctly in subprocesses only if they are created by "fork" method
+mp_start_method = fork
Review Comment:
It's know issue that MacOS doesn't work correctly in fork mode in Python (https://github.com/python/cpython/issues/58037 and https://bugs.python.org/issue30385#msg293958), that basically why spawn default method in python.
Airflow itself use `fork` in some places [even in MacOS](https://github.com/apache/airflow/blob/b82ce61285f3f4f0c7eccb2c3effaef53c9fb84e/airflow/settings.py#L552) and that the main reason for Segmentation Faults, in some other places [it is controlled by](https://github.com/apache/airflow/blob/58d8577f3528e7e143addefb03711bdc82cb1782/airflow/utils/mixins.py#L41-L42) `mp_start_method`.
So I would be very surprised if this change fix in one place and do not break in another. In conclusion I want to say that some tests just not work in MacOS and developer should use Breeze however I have no objection to adding this.
--
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