Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix database isolation case for task mapping taskinstance tests #41471

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/models/test_taskinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,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 @@ -1540,6 +1543,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