Skip to content

Commit

Permalink
Skip database isolation case for task mapping taskinstance tests (apa…
Browse files Browse the repository at this point in the history
…che#41954) (apache#41954)

* Simpler task retrieval for taskinstance test (apache#41389)

The test has been updated for DB isolation but the retrieval of
task was not intuitive and it could lead to flaky tests possibly

(cherry picked from commit f25adf1)

* Skip  database isolation case for task mapping taskinstance tests (apache#41471)

Related: apache#41067
(cherry picked from commit 7718bd7)

---------

Co-authored-by: Jarek Potiuk <[email protected]>
Co-authored-by: Tzu-ping Chung <[email protected]>
  • Loading branch information
3 people authored Sep 3, 2024
1 parent 93dd685 commit 7f49cfc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/models/test_taskinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,10 @@ def test_check_task_dependencies(
# Parameterized tests to check for the correct firing
# of the trigger_rule under various circumstances of mapped task
# Numeric fields are in order:
# successes, skipped, failed, upstream_failed, done,removed
# successes, skipped, failed, upstream_failed, done,remove
# Does not work for database isolation mode because there is local test monkeypatching of upstream_failed
# That never gets propagated to internal_api
@pytest.mark.skip_if_database_isolation_mode
@pytest.mark.parametrize(
"trigger_rule, upstream_states, flag_upstream_failed, expect_state, expect_completed",
[
Expand Down Expand Up @@ -1541,6 +1544,7 @@ def do_something_else(i):
ti = dr.get_task_instance("do_something_else", session=session)
ti.map_index = 0
base_task = ti.task

for map_index in range(1, 5):
ti = TaskInstance(base_task, run_id=dr.run_id, map_index=map_index)
session.add(ti)
Expand Down

0 comments on commit 7f49cfc

Please sign in to comment.