Skip to content

Commit

Permalink
Improve startup of K8S tests (#42721) (#43025)
Browse files Browse the repository at this point in the history
  • Loading branch information
gopidesupavan authored Oct 15, 2024
1 parent 744d2b0 commit f494a54
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion kubernetes_tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,16 @@ def ensure_dag_expected_state(self, host, execution_date, dag_id, expected_final
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:
Expand Down

0 comments on commit f494a54

Please sign in to comment.