This is an automated email from the ASF dual-hosted git repository.
potiuk 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 8cd1a7ed3f Stabilize remaining BranchDecoratedOperators tests (#35554)
8cd1a7ed3f is described below
commit 8cd1a7ed3f3e8a04d6d9b3e5c7dc543eb05a782b
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu Nov 9 16:07:07 2023 +0100
Stabilize remaining BranchDecoratedOperators tests (#35554)
As a follow-up after #35511 it turned out that we have THREE
tests which are named Test_BranchDecoratedOperator - because they
were copied originally from the "Python" one - there is a Python,
ExternalPython and PythonVirtualenv tests :).
The #35551 only added timeout in one of them - and in the least
problematic one at that (Python). This PR also adds it in the
other tests and renames the tests classes to distinguish between
the different tests (to more easily see which one failed).
---
tests/decorators/test_branch_external_python.py | 6 +++++-
tests/decorators/test_branch_virtualenv.py | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/tests/decorators/test_branch_external_python.py
b/tests/decorators/test_branch_external_python.py
index ca62e038f1..745edafae8 100644
--- a/tests/decorators/test_branch_external_python.py
+++ b/tests/decorators/test_branch_external_python.py
@@ -27,7 +27,11 @@ from airflow.utils.state import State
pytestmark = pytest.mark.db_test
-class Test_BranchPythonDecoratedOperator:
+class Test_BranchExternalPythonDecoratedOperator:
+ # when run in "Parallel" test run environment, sometimes this test runs
for a long time
+ # because creating virtualenv and starting new Python interpreter creates
a lot of IO/contention
+ # possibilities. So we are increasing the timeout for this test to 3x of
the default timeout
+ @pytest.mark.execution_timeout(180)
@pytest.mark.parametrize("branch_task_name", ["task_1", "task_2"])
def test_branch_one(self, dag_maker, branch_task_name):
@task
diff --git a/tests/decorators/test_branch_virtualenv.py
b/tests/decorators/test_branch_virtualenv.py
index 66f539ca4c..2b5f9bb95e 100644
--- a/tests/decorators/test_branch_virtualenv.py
+++ b/tests/decorators/test_branch_virtualenv.py
@@ -25,7 +25,11 @@ from airflow.utils.state import State
pytestmark = pytest.mark.db_test
-class Test_BranchPythonDecoratedOperator:
+class Test_BranchPythonVirtualenvDecoratedOperator:
+ # when run in "Parallel" test run environment, sometimes this test runs
for a long time
+ # because creating virtualenv and starting new Python interpreter creates
a lot of IO/contention
+ # possibilities. So we are increasing the timeout for this test to 3x of
the default timeout
+ @pytest.mark.execution_timeout(180)
@pytest.mark.parametrize("branch_task_name", ["task_1", "task_2"])
def test_branch_one(self, dag_maker, branch_task_name):
@task