EamonKeane commented on a change in pull request #4160: [AIRFLOW-3311] Allow 
pod operator to keep failed pods
URL: https://github.com/apache/incubator-airflow/pull/4160#discussion_r238701520
 
 

 ##########
 File path: tests/contrib/minikube/test_kubernetes_pod_operator.py
 ##########
 @@ -111,6 +111,21 @@ def test_delete_operator_pod():
         )
         k.execute(None)
 
+    def test_keep_failed_pod(self):
+        k = KubernetesPodOperator(
+            namespace='default',
+            image="ubuntu:16.04",
+            cmds=["bash", "-cx"],
+            arguments=["exit 1"],
+            labels={"foo": "bar"},
+            name="test",
+            task_id="task",
+            is_delete_operator_pod=True,
+            keep_failed_pod=True
+        )
+        with self.assertRaises(AirflowException):
+            k.execute(None)
 
 Review comment:
   many thanks fo reviewing the PR, those comments all make sense.
   
   That's a fair comment about this test. Would sleeping for e.g. 10 seconds 
and then asserting the pod is still in the namespace and in a failed state be 
sufficient to test it?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to