This is an automated email from the ASF dual-hosted git repository.

amoghdesai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 632bfe7b28c Eliminate race condition in 
test_apply_version_suffix_to_non_provider_pyproject_tomls due to xdist runs 
(#58593)
632bfe7b28c is described below

commit 632bfe7b28c85d2904cb66318739aa93e3880b74
Author: Amogh Desai <[email protected]>
AuthorDate: Sun Nov 23 17:14:54 2025 +0530

    Eliminate race condition in 
test_apply_version_suffix_to_non_provider_pyproject_tomls due to xdist runs 
(#58593)
---
 dev/breeze/tests/test_packages.py | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/dev/breeze/tests/test_packages.py 
b/dev/breeze/tests/test_packages.py
index ec84729f83a..ea9fbfebc49 100644
--- a/dev/breeze/tests/test_packages.py
+++ b/dev/breeze/tests/test_packages.py
@@ -401,6 +401,23 @@ TASK_SDK_INIT_PY = AIRFLOW_ROOT_PATH / "task-sdk" / "src" 
/ "airflow" / "sdk" /
 AIRFLOWCTL_INIT_PY = AIRFLOW_ROOT_PATH / "airflow-ctl" / "src" / "airflowctl" 
/ "__init__.py"
 
 
[email protected]
+def restore_version_files():
+    # save contents of all version files before test starts
+    version_files = [
+        AIRFLOW_CORE_INIT_PY,
+        TASK_SDK_INIT_PY,
+        AIRFLOWCTL_INIT_PY,
+    ]
+    original_contents = {f: f.read_text() for f in version_files if f.exists()}
+
+    yield
+
+    # restore original contents after test
+    for fp, content in original_contents.items():
+        fp.write_text(content)
+
+
 @pytest.mark.parametrize(
     ("distributions", "init_file_path", "version_suffix", 
"floored_version_suffix"),
     [
@@ -428,7 +445,11 @@ AIRFLOWCTL_INIT_PY = AIRFLOW_ROOT_PATH / "airflow-ctl" / 
"src" / "airflowctl" /
     ],
 )
 def test_apply_version_suffix_to_non_provider_pyproject_tomls(
-    distributions: tuple[str, ...], init_file_path: Path, version_suffix: str, 
floored_version_suffix: str
+    restore_version_files,
+    distributions: tuple[str, ...],
+    init_file_path: Path,
+    version_suffix: str,
+    floored_version_suffix: str,
 ):
     """
     Test the apply_version_suffix function with different version suffixes for 
pyproject.toml of non-provider.

Reply via email to