Vamsi-klu opened a new pull request, #66294: URL: https://github.com/apache/airflow/pull/66294
`task_runner.main()` (the subprocess path) sets `context["exception"] = error` immediately after `run()` and before `finalize()` so failure/retry callbacks can read the raised exception from context. The in-process supervisor used by `dag.test()` did not mirror that contract, so `on_failure_callback` and `on_retry_callback` saw `context["exception"]` as missing/None when invoked via `dag.test()`. This patches `InProcessTestSupervisor.start()` to mirror the subprocess path. ## Tests - Unit regression in `test_supervisor.py::TestInProcessTestSupervisor::test_start_sets_exception_in_context_before_finalize` (parametrized over `FAILED` and `UP_FOR_RETRY`) — verified to fail without the fix and pass with it. - End-to-end `dag.test()` regression in `test_dag.py::TestDag::test_dag_test_failure_callback_receives_exception_in_context`. closes: #64568 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 4.7) Generated-by: Claude Code (Opus 4.7) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
