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

kaxilnaik pushed a commit to branch v2-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v2-10-test by this push:
     new 9f87313d1ae Fix DB isolation tests on v2-10-test (#45021)
9f87313d1ae is described below

commit 9f87313d1aec2f74d006533648907397448dcdc5
Author: Jens Scheffler <[email protected]>
AuthorDate: Wed Dec 18 10:05:14 2024 +0100

    Fix DB isolation tests on v2-10-test (#45021)
    
    I failed in backporting to v2-10-test, but in both PRs some else "falls 
apart".
    
    This PR fixes DB Isolation test reported as "failed" from a test CI run in 
https://github.com/apache/airflow/actions/runs/12388030828/job/34578488895
    
    From my point of view the tests are OK in general but just test are broken 
in DB isolation mode. Seems not really being a harm in 2.10.4.
---
 tests/models/test_mappedoperator.py | 2 ++
 tests/models/test_skipmixin.py      | 2 ++
 tests/models/test_taskinstance.py   | 1 +
 3 files changed, 5 insertions(+)

diff --git a/tests/models/test_mappedoperator.py 
b/tests/models/test_mappedoperator.py
index dd335f9ef89..473a2224830 100644
--- a/tests/models/test_mappedoperator.py
+++ b/tests/models/test_mappedoperator.py
@@ -1786,6 +1786,7 @@ class TestMappedSetupTeardown:
         assert states == expected
 
 
[email protected]_if_database_isolation_mode  # Does not work in db isolation 
mode
 def 
test_mapped_tasks_in_mapped_task_group_waits_for_upstreams_to_complete(dag_maker,
 session):
     """Test that one failed trigger rule works well in mapped task group"""
     with dag_maker() as dag:
@@ -1817,6 +1818,7 @@ def 
test_mapped_tasks_in_mapped_task_group_waits_for_upstreams_to_complete(dag_m
     assert not ti3.state
 
 
[email protected]_if_database_isolation_mode  # Does not work in db isolation 
mode
 def 
test_mapped_tasks_in_mapped_task_group_waits_for_upstreams_to_complete__mapped_skip_with_all_success(
     dag_maker, session
 ):
diff --git a/tests/models/test_skipmixin.py b/tests/models/test_skipmixin.py
index 72ad956ae4c..87001d0236f 100644
--- a/tests/models/test_skipmixin.py
+++ b/tests/models/test_skipmixin.py
@@ -116,6 +116,7 @@ class TestSkipMixin:
         assert not session.query.called
         assert not session.commit.called
 
+    @pytest.mark.skip_if_database_isolation_mode  # Does not work in db 
isolation mode
     def test_skip_mapped_task(self, mock_session):
         SkipMixin()._skip(
             dag_run=MagicMock(spec=DagRun),
@@ -128,6 +129,7 @@ class TestSkipMixin:
         mock_session.execute.assert_not_called()
         mock_session.commit.assert_not_called()
 
+    @pytest.mark.skip_if_database_isolation_mode  # Does not work in db 
isolation mode
     @patch("airflow.models.skipmixin.update")
     def test_skip_none_mapped_task(self, mock_update, mock_session):
         SkipMixin()._skip(
diff --git a/tests/models/test_taskinstance.py 
b/tests/models/test_taskinstance.py
index b5dcb43de26..15a9eb1ba33 100644
--- a/tests/models/test_taskinstance.py
+++ b/tests/models/test_taskinstance.py
@@ -3768,6 +3768,7 @@ class TestTaskInstance:
         ti.refresh_from_db()
         assert ti.state == State.SUCCESS
 
+    @pytest.mark.skip_if_database_isolation_mode  # Does not work in db 
isolation mode, fails in context serialization
     @pytest.mark.parametrize(
         "code, expected_state",
         [

Reply via email to