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:10:31 UTC

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

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


With regards,
Apache Git Services