Commit 5af83ea
committed
Reproduce executor-side session detachment via scoped session in test
Review asked for the concrete code path that detaches the TaskInstances
rather than simulating it with session.expunge(). The mechanism is the
executor opening and closing a scoped session while adopting:
create_session() returns the scheduler's own thread-scoped session and
closes it on exit, expunging everything the orphan query loaded.
KubernetesExecutor's completed-pod adoption did exactly this from #66400
until #67850, and released providers up to 10.17.x still ship it (the
combination Airflow 3.2.2 constraints pin). The mock now performs that
exact operation, so the test exercises the production mechanism
end-to-end instead of hand-detaching instances.1 parent b1ee077 commit 5af83ea
1 file changed
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3659 | 3659 | | |
3660 | 3660 | | |
3661 | 3661 | | |
3662 | | - | |
3663 | | - | |
3664 | | - | |
3665 | | - | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
| 3669 | + | |
3666 | 3670 | | |
3667 | 3671 | | |
3668 | 3672 | | |
| |||
3689 | 3693 | | |
3690 | 3694 | | |
3691 | 3695 | | |
3692 | | - | |
3693 | | - | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
3694 | 3702 | | |
3695 | 3703 | | |
3696 | 3704 | | |
| |||
0 commit comments