henry3260 commented on code in PR #76328:
URL: https://github.com/apache/airflow/pull/76328#discussion_r4454384018


##########
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/operators/test_job.py:
##########
@@ -988,6 +988,47 @@ def test_execute_complete_fail(self):
 
         mock_ti.xcom_push.assert_called_once_with(key="job", value=mock_job)
 
+    @pytest.mark.non_db_test_override

Review Comment:
   Could you parametrize these two tests?



##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/job.py:
##########
@@ -338,16 +338,20 @@ def execute_complete(self, context: Context, event: dict, 
**kwargs):
         try:
             ti = context["ti"]
             ti.xcom_push(key="job", value=event["job"])
-            if event["status"] == "error":
-                raise AirflowException(event["message"])
 
             if self.get_logs:
                 for pod_name in event.get("pod_names") or []:

Review Comment:
   I think we should collect all the Job's failed pods, not just the first one.
   Right now `get_pods()` is called right after `create_job()`, so the
   pod list is fixed at that moment any pod the Job controller creates later 
for a `backoffLimit` retry is never in `event["pod_names"]`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to