Skip to content

Fix stale-session assertion in mapped placeholder promotion test - #75175

Merged
vatsrahul1001 merged 1 commit into
apache:mainfrom
astronomer:fix-stale-placeholder-promotion-test
Oct 20, 2026
Merged

vatsrahul1001 merged 1 commit into
apache:mainfrom
astronomer:fix-stale-placeholder-promotion-test

Conversation

@jedcunningham

Copy link
Copy Markdown
Member

test_promotion_leaves_earlier_placeholder_task_instances_at_their_coordinates asserted that the archived -1 attempt of a mapped task stays after expansion. Since #74407, expand_mapped_task deletes those attempts, and the DB row is gone. The test still passed because the delete uses synchronize_session=False and session.get() returned the stale identity-map object.

The test now expires the session, queries the database (including archived attempts), asserts the row is deleted, and is renamed to test_promotion_deletes_earlier_placeholder_task_instances. This makes it consistent with test_expand_mapped_task_deletes_archived_attempts_of_the_unmapped_task_instance.

related: #74407

test_promotion_leaves_earlier_placeholder_task_instances_at_their_coordinates
asserted that the archived -1 attempt of a mapped task survives expansion.
Since apache#74407 expansion deletes those attempts, but the delete runs with
synchronize_session=False, so session.get() kept returning the stale
identity-map object and the test passed while asserting the opposite of
what the database holds.

Expire the session and query the database, asserting the archived
placeholder attempt is gone, and rename the test to match.
@jedcunningham
jedcunningham requested a review from ashb October 20, 2026 02:15
@jedcunningham jedcunningham added the backport-to-v3-4-test Backport to v3-4-test label Oct 20, 2026
@jedcunningham jedcunningham added this to the Airflow 3.4.0 milestone Oct 20, 2026
@vatsrahul1001
vatsrahul1001 merged commit 11ed204 into apache:main Oct 20, 2026
66 checks passed
@vatsrahul1001
vatsrahul1001 deleted the fix-stale-placeholder-promotion-test branch October 20, 2026 03:47
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

vatsrahul1001 pushed a commit that referenced this pull request Oct 20, 2026
…on test (#75175) (#75181)

test_promotion_leaves_earlier_placeholder_task_instances_at_their_coordinates
asserted that the archived -1 attempt of a mapped task survives expansion.
Since #74407 expansion deletes those attempts, but the delete runs with
synchronize_session=False, so session.get() kept returning the stale
identity-map object and the test passed while asserting the opposite of
what the database holds.

Expire the session and query the database, asserting the archived
placeholder attempt is gone, and rename the test to match.
(cherry picked from commit 11ed204)

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request Oct 20, 2026
…on test (#75175) (#75181)

test_promotion_leaves_earlier_placeholder_task_instances_at_their_coordinates
asserted that the archived -1 attempt of a mapped task survives expansion.
Since #74407 expansion deletes those attempts, but the delete runs with
synchronize_session=False, so session.get() kept returning the stale
identity-map object and the test passed while asserting the opposite of
what the database holds.

Expire the session and query the database, asserting the archived
placeholder attempt is gone, and rename the test to match.
(cherry picked from commit 11ed204)

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v3-4-test Backport to v3-4-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants