You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jason810496 (via GitHub)" <gi...@apache.org> on 2026/03/05 03:57:16 UTC

[PR] Add e2e test for XComObjectStorageBackend [airflow]

jason810496 opened a new pull request, #62907:
URL: https://github.com/apache/airflow/pull/62907

   related:
   - issue: #62691
   - PR: #62701
   
   ## Why
   
   To prevent `XComObjectStorageBackend` on latest main branch like #62691. It would be better to introduce an e2e test for `XComObjectStorageBackend` like how we implement the remote logging e2e tests.
   
   ## What
   
   - Add e2e test for XComObjectStorageBackend.
   - Consolidate some common utils for both remote logging and XCom Object Store e2e tests.
   
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes (please specify the tool below) Claude Code
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add e2e test for XComObjectStorageBackend [airflow]

Posted by "jason810496 (via GitHub)" <gi...@apache.org>.
jason810496 merged PR #62907:
URL: https://github.com/apache/airflow/pull/62907


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add e2e test for XComObjectStorageBackend [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #62907:
URL: https://github.com/apache/airflow/pull/62907#issuecomment-4020735022

   ### Backport failed to create: v3-1-test. View the failure log <a href='https://github.com/apache/airflow/actions/runs/22836193402'> Run details </a>
   
   Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x)
   the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.
   
   In matter of doubt please ask in [#release-management](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel.
   
   <table>
       <tr>
           <th>Status</th>
           <th>Branch</th>
           <th>Result</th>
       </tr>
       <tr>
           <td>❌</td>
           <td>v3-1-test</td>
           <td><a href="https://github.com/apache/airflow/commit/cb586ce385b4699e2c7376c55e7f825a0306dd75"><img src='https://img.shields.io/badge/Commit-cb586ce-red' alt='Commit Link'></a></td>
       </tr>
   </table>
   
   You can attempt to backport this manually by running:
   
   ```bash
   cherry_picker cb586ce v3-1-test
   ```
   
   This should apply the commit to the v3-1-test branch and leave the commit in conflict state marking
   the files that need manual conflict resolution.
   
   After you have resolved the conflicts, you can continue the backport process by running:
   
   ```bash
   cherry_picker --continue
   ```
   
   If you don't have cherry-picker installed, see the [installation guide](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#how-to-backport-pr-with-cherry-picker-cli).
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add e2e test for XComObjectStorageBackend [airflow]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #62907:
URL: https://github.com/apache/airflow/pull/62907#discussion_r2894235347


##########
airflow-e2e-tests/tests/airflow_e2e_tests/xcom_object_storage_tests/test_xcom_object_storage_backend.py:
##########
@@ -0,0 +1,89 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import time
+from datetime import datetime, timezone
+from pprint import pprint
+from uuid import uuid4
+
+import pytest
+
+from airflow_e2e_tests.constants import XCOM_BUCKET
+from airflow_e2e_tests.e2e_test_utils.clients import AirflowClient, get_s3_client
+
+
+class TestXComObjectStorageBackend:
+    airflow_client = AirflowClient()
+    dag_id = "example_xcom_test"
+    retry_interval_in_seconds = 5
+    max_retries = 12
+
+    def test_dag_succeeds_and_xcom_values_stored_in_s3(self):
+        """Test that a DAG using XComObjectStorageBackend completes successfully and persists XCom values to S3."""
+        self.airflow_client.un_pause_dag(self.dag_id)
+
+        trigger_resp = self.airflow_client.trigger_dag(
+            self.dag_id,
+            json={
+                "dag_run_id": f"test_xcom_object_storage_backend_{uuid4()}",
+                "logical_date": datetime.now(timezone.utc).isoformat(),
+            },
+        )
+        dag_run_id = trigger_resp["dag_run_id"]
+        state = self.airflow_client.wait_for_dag_run(
+            dag_id=self.dag_id,
+            run_id=dag_run_id,
+        )
+
+        # try to get all the logs to help debugging
+        if state != "success":
+            task_instances_resp = self.airflow_client.get_task_instances(self.dag_id, dag_run_id)
+            for task_instance in task_instances_resp["task_instances"]:
+                task_id = task_instance["task_id"]
+                try_number = task_instance["try_number"]
+                try:
+                    print(f"\nLogs for task {task_id} (try {try_number}):")
+                    task_logs_resp = self.airflow_client.get_task_logs(
+                        dag_id=self.dag_id, task_id="bash_pull", run_id=dag_run_id, try_number=try_number

Review Comment:
   Bug: The debug log-fetching loop iterates over all task instances but always fetches logs for `task_id="bash_pull"` instead of using the `task_id` variable extracted from each task instance. This means when the DAG fails, you'll only see `bash_pull` logs repeated for every task instance, making debugging harder. The `task_id` parameter should use the `task_id` variable from the loop.
   ```suggestion
                           dag_id=self.dag_id, task_id=task_id, run_id=dag_run_id, try_number=try_number
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org