Repository navigation
Conversation
|
@ashb Gentle ping! You looked at this briefly earlier (thanks for the title fix). Would appreciate a review when you have a moment. |
f1a6834 to
5a5c67f
Compare
|
Rebased onto current main (applied without conflicts). The fix is still needed — This has not had a full CI run yet: the workflows have been at Both items in the Aug 13 triage note are resolved: the task-sdk failures were this PR's own new test missing the |
5a5c67f to
032d2ea
Compare
|
Rebased onto main to fix the conflict. Could a maintainer approve the CI run? |
The task.duration metric went missing for skipped tasks because finalize() only emits it when ti.end_date is set, and the skip path left it unset. apache#75685 fixed the code path for listeners but did not assert on the metric, so nothing guards against the gate being broken again.
032d2ea to
10b139d
Compare
|
#75685 landed the same |
Summary
task.durationwas not emitted for skipped tasks:finalize()only emits it whenti.end_dateis set, and the skip paths setend_dateon the outboundTaskStatemessage but not on the local task instance. Reproducible withShortCircuitOperator,BranchPythonOperator, andBashOperatorwithskip_on_exit_code(narrowed in #61849).The code change originally proposed here landed separately in #75685, which asserts on
ti.end_dateand listeners but not on the metric. This PR now adds only a regression test for the metric itself, so a future change to thefinalize()gate cannot droptask.durationfor a terminal state unnoticed.Test plan
test_task_duration_metric_emitted_for_terminal_statescoverssuccess/skipped/failed, checkingtask.durationwith its tags and the legacy dotted name.ti.end_dateassignment from Let listeners see the end date of a skipped task instance #75685 makes[skipped]fail;[success]and[failed]still pass.TestTaskInstanceMetricspasses (14 tests);ruff format/ruff checkand the commit's prek hooks pass.closes: #61849
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5.5) following the guidelines