[v3-2-test] Add jobless_supervisor fixture for backported triggerer-FD test#66743
Merged
potiuk merged 1 commit intoMay 12, 2026
Merged
Conversation
…D test v3-2-test is currently red because the test test_trigger_logger_fd_closed_when_upload_to_remote_raises (backported via apache#66684 from apache#66675) consumes a `jobless_supervisor` fixture that was never backported to this branch. Root cause: the fixture was added on main by apache#66006 ("Make TriggerRunnerSupervisor.job optional"), which is a feature change and was correctly skipped from release-branch backports. The subsequent fix backport (apache#66684) brought only the test definition, so the test errored at setup with "fixture 'jobless_supervisor' not found" across every DB/Python matrix cell. Cherry-picking apache#66006 wholesale isn't viable: 4 conflict regions in triggerer_job_runner.py totalling ~150 lines (v3-2-test has diverged since 2026-04-30), and it would drag a feature into a release branch. Instead, add the fixture inline with the same name and shape as main's but adapted for v3-2-test's still-required `job: Job` constraint — use mocker.Mock(spec=Job) instead of job=None. The test only exercises logger_cache, running_triggers, and _handle_request, none of which touch the .job attribute, so the mock is sufficient.
potiuk
added a commit
that referenced
this pull request
May 12, 2026
The backport's test imports TIClaims from airflow.api_fastapi.execution_api.datamodels.token, but TIClaims was added on main by #63604 ("Validate task identity token claims with a typed schema") which was not backported to v3-2-test. On v3-2-test, TIToken.claims is still typed as `dict[str, Any]` (loose dict), so the test can construct it with a plain dict instead of the TIClaims model. Drops the TIClaims import and replaces TIClaims(scope="execution") with {"scope": "execution"}. This is the same shape of fix as #66743 — backport's test references a symbol that exists only on main. Inlining the adapted construction avoids a feature backport (#63604) just to satisfy a test fixture's typed argument.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v3-2-testis currently red becauseairflow-core/tests/unit/jobs/test_triggerer_job.py::test_trigger_logger_fd_closed_when_upload_to_remote_raisesfails at setup withfixture 'jobless_supervisor' not found.Root cause
The test was backported to v3-2-test by #66684 (auto-cherry-pick of #66675). But the
jobless_supervisorfixture that the test consumes was added onmainby a different, earlier PR — #66006 "Make TriggerRunnerSupervisor.job optional" — which was not backported to v3-2-test because it's a feature change, not a fix.So the test cherry-pick brought a single test definition that references a fixture that doesn't exist on this branch. Setup error → 1 ERROR → all Core...Serialization jobs red across every DB/Python matrix cell.
Why not cherry-pick #66006
Tried it; conflicts in 4 regions of
airflow-core/src/airflow/jobs/triggerer_job_runner.pytotalling ~150 lines (v3-2-test has diverged since 2026-04-30). Also: #66006 is a feature (makesTriggerRunnerSupervisor.joboptional). v3-2-test should generally take only fix backports, so dragging the whole feature in just to satisfy a fixture name is the wrong shape.What this PR does
Adds a
jobless_supervisorfixture to v3-2-test'stest_triggerer_job.py, with the same name and shape as main's, but adapted for the fact thatTriggerRunnerSupervisor.jobis still required on this branch. Usesmocker.Mock(spec=Job)instead ofjob=None. The test that consumes it (test_trigger_logger_fd_closed_when_upload_to_remote_raises) only exerciseslogger_cache,running_triggers, and_handle_request— none of which touch.job— so the mock is sufficient.Test plan
uv run --project airflow-core pytest airflow-core/tests/unit/jobs/test_triggerer_job.py::test_trigger_logger_fd_closed_when_upload_to_remote_raises -xvs— PASSED on this branch.jobless_supervisoron v3-2-test (would be unintended scope creep).Was generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 4.7 (1M context) following the guidelines