SameerMesiah97 commented on code in PR #61110:
URL: https://github.com/apache/airflow/pull/61110#discussion_r2756117794


##########
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/operators/test_spark_kubernetes.py:
##########
@@ -1029,30 +1148,32 @@ def test_find_spark_job_picks_latest_pod(
             get_logs=True,
             reattach_on_restart=True,
         )
-        context = create_context(op)
 
-        # Older pod that should be ignored.
-        old_mock_pod = mock.MagicMock()
-        old_mock_pod.metadata.creation_timestamp = timezone.datetime(2025, 1, 
1, tzinfo=timezone.utc)
-        old_mock_pod.metadata.name = "spark-driver-old"
-        old_mock_pod.status.phase = PodPhase.RUNNING
+        context = create_context(op)
 
-        # Newer pod that should be picked up.
-        new_mock_pod = mock.MagicMock()
-        new_mock_pod.metadata.creation_timestamp = timezone.datetime(2025, 1, 
2, tzinfo=timezone.utc)
-        new_mock_pod.metadata.name = "spark-driver-new"
-        new_mock_pod.status.phase = PodPhase.RUNNING
+        # Latest pod should be selected.
+        pending_pod = mock.MagicMock()
+        pending_pod.metadata.creation_timestamp = timezone.datetime(2025, 1, 
3, tzinfo=timezone.utc)
+        pending_pod.metadata.name = "spark-driver"
+        pending_pod.metadata.labels = {"try_number": "1"}
+        pending_pod.status.phase = "Pending"
 
-        # Same try_number to simulate abrupt failure scenarios (e.g. scheduler 
crash)
-        # where cleanup did not occur and multiple pods share identical labels.
-        old_mock_pod.metadata.labels = {"try_number": "1"}
-        new_mock_pod.metadata.labels = {"try_number": "1"}
+        # Terminating pod should not be selected.

Review Comment:
   Should be:
   
   ` # Older pod should not be selected.`



-- 
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