From cec9c1af537fe5f179cd5c2604594fe96adf8b3d Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Thu, 2 Jul 2026 10:57:25 +0200 Subject: [PATCH] Fix OTel integration test for new task.execute detail span #67877 added a task.execute detail span around the task execute callable at task span detail level > 1, so operator-emitted spans (such as sub_span1) now nest under it instead of directly under _execute_task. That PR did not update the OTel integration test's expected span hierarchy, and because the OTel integration suite runs only on schedule/canary rather than per-PR, the change merged green and test_dag_execution_succeeds[detail_spans] has been failing on main since. Update the expected hierarchy to include the task.execute span. --- airflow-core/tests/integration/otel/test_otel.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/airflow-core/tests/integration/otel/test_otel.py b/airflow-core/tests/integration/otel/test_otel.py index d19756094b6ce..1f24e2ec4f6cd 100644 --- a/airflow-core/tests/integration/otel/test_otel.py +++ b/airflow-core/tests/integration/otel/test_otel.py @@ -469,7 +469,10 @@ def test_export_metrics_during_process_shutdown(self, capfd): "_execute_task": "run", "finalize": "worker.task1", "run": "worker.task1", - "sub_span1": "_execute_task", + # At detail level > 1 the execute callable is wrapped in its own + # task.execute span, so operator-emitted spans nest under it. + "task.execute": "_execute_task", + "sub_span1": "task.execute", "dag_run.otel_test_dag": None, "task_run.task1": "dag_run.otel_test_dag", "worker.task1": "task_run.task1",