Skip to content

[v3-2-test] Add jobless_supervisor fixture for backported triggerer-FD test#66743

Merged
potiuk merged 1 commit into
apache:v3-2-testfrom
potiuk:fix-jobless-supervisor-fixture-v3-2-test
May 12, 2026
Merged

[v3-2-test] Add jobless_supervisor fixture for backported triggerer-FD test#66743
potiuk merged 1 commit into
apache:v3-2-testfrom
potiuk:fix-jobless-supervisor-fixture-v3-2-test

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented May 12, 2026

Summary

v3-2-test is currently red because airflow-core/tests/unit/jobs/test_triggerer_job.py::test_trigger_logger_fd_closed_when_upload_to_remote_raises fails at setup with fixture 'jobless_supervisor' not found.

Root cause

The test was backported to v3-2-test by #66684 (auto-cherry-pick of #66675). But the jobless_supervisor fixture that the test consumes was added on main by 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.py totalling ~150 lines (v3-2-test has diverged since 2026-04-30). Also: #66006 is a feature (makes TriggerRunnerSupervisor.job optional). 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_supervisor fixture to v3-2-test's test_triggerer_job.py, with the same name and shape as main's, but adapted for the fact that TriggerRunnerSupervisor.job is still required on this branch. Uses mocker.Mock(spec=Job) instead of job=None. The test that consumes it (test_trigger_logger_fd_closed_when_upload_to_remote_raises) only exercises logger_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.
  • No other test references jobless_supervisor on v3-2-test (would be unintended scope creep).
  • Fixture matches main's naming so a future full backport of Make TriggerRunnerSupervisor.job optional #66006 will replace it cleanly without name churn.

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Opus 4.7 (1M context)

Generated-by: Claude Opus 4.7 (1M context) following the guidelines

…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 potiuk merged commit 16a1097 into apache:v3-2-test May 12, 2026
76 checks passed
@potiuk potiuk deleted the fix-jobless-supervisor-fixture-v3-2-test branch May 12, 2026 01:33
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant