You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/12/04 15:15:10 UTC

[GitHub] ashb commented on a change in pull request #4160: [AIRFLOW-3311] Allow pod operator to keep failed pods

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

 ##########
 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:
   I'd like to avoid sleep in tests if we can (but it might not be avoidable) - does the pod enter a "deleting" state instantly? If so could we test that `not pod_exists or pod_in_deleteing_state`?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services