From 10b9b2d42193e72406ed185ea993ae51dc023209 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Thu, 9 Nov 2023 15:41:39 +0100 Subject: [PATCH] Stabilize remaining BranchDecoratedOperators tests 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 ca62e038f1ea5..745edafae86ce 100644 --- a/tests/decorators/test_branch_external_python.py +++ b/tests/decorators/test_branch_external_python.py @@ -27,7 +27,11 @@ 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 66f539ca4c988..2b5f9bb95ed73 100644 --- a/tests/decorators/test_branch_virtualenv.py +++ b/tests/decorators/test_branch_virtualenv.py @@ -25,7 +25,11 @@ 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