This is an automated email from the ASF dual-hosted git repository.
rom pushed a commit to branch v2-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v2-10-test by this push:
new f494a549c7 Improve startup of K8S tests (#42721) (#43025)
f494a549c7 is described below
commit f494a549c77808b8a45387989186228141797100
Author: GPK <[email protected]>
AuthorDate: Tue Oct 15 10:25:26 2024 +0100
Improve startup of K8S tests (#42721) (#43025)
---
kubernetes_tests/test_base.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/kubernetes_tests/test_base.py b/kubernetes_tests/test_base.py
index df5f520c62..ac311daa52 100644
--- a/kubernetes_tests/test_base.py
+++ b/kubernetes_tests/test_base.py
@@ -223,7 +223,16 @@ class BaseK8STest:
def start_dag(self, dag_id, host):
patch_string = f"http://{host}/api/v1/dags/{dag_id}"
print(f"Calling [start_dag]#1 {patch_string}")
- result = self.session.patch(patch_string, json={"is_paused": False})
+ max_attempts = 10
+ result = {}
+ while max_attempts:
+ result = self.session.patch(patch_string, json={"is_paused":
False})
+ if result.status_code == 200:
+ break
+
+ time.sleep(30)
+ max_attempts -= 1
+
try:
result_json = result.json()
except ValueError: