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 2020/01/25 23:25:33 UTC

[GitHub] [airflow] potiuk commented on a change in pull request #7261: [AIRFLOW-6641] Better diagnostics for kubernetes flaky tests

potiuk commented on a change in pull request #7261: [AIRFLOW-6641] Better diagnostics for kubernetes flaky tests
URL: https://github.com/apache/airflow/pull/7261#discussion_r370962245
 
 

 ##########
 File path: tests/runtime/kubernetes/test_kubernetes_executor.py
 ##########
 @@ -92,18 +96,39 @@ def monitor_task(self, host, execution_date, dag_id, task_id, expected_final_sta
                 tries += 1
             except requests.exceptions.ConnectionError as e:
                 check_call(["echo", "api call failed. trying again. error {}".format(e)])
-
+        if state != expected_final_state:
+            print("The expected state is wrong {} != {} (expected)!".format(state, expected_final_state))
+            self.dump_kubernetes_logs()
         self.assertEqual(state, expected_final_state)
 
-        # Maybe check if we can retrieve the logs, but then we need to extend the API
+    def dump_kubernetes_logs(self):
+        if os.environ.get('ENABLE_KIND_CLUSTER') == 'true':
+            self.dump_kind_logs()
+
+    def dump_kind_logs(self):
+        tempdir_path = mkdtemp()
 
 Review comment:
   I want to cherry-pick it to 1.10  - with python 2.7 support, I considered TemporaryDirectory - but it won't work there I am afraid .

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services