This is an automated email from the ASF dual-hosted git repository.

gopidesu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 83883fae10a Ignore requests RetryError in k8s tests (#44094)
83883fae10a is described below

commit 83883fae10a00106974996b8cc4834779ac8e444
Author: GPK <[email protected]>
AuthorDate: Sat Nov 16 10:13:36 2024 +0000

    Ignore requests RetryError in k8s tests (#44094)
    
    * ignore requests retry error in k8s tests
    
    * ignore requests retry error in k8s tests
---
 kubernetes_tests/test_base.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kubernetes_tests/test_base.py b/kubernetes_tests/test_base.py
index 521a02ddd91..98b92b40bb3 100644
--- a/kubernetes_tests/test_base.py
+++ b/kubernetes_tests/test_base.py
@@ -29,6 +29,7 @@ import re2
 import requests
 import requests.exceptions
 from requests.adapters import HTTPAdapter
+from requests.exceptions import RetryError
 from urllib3.exceptions import MaxRetryError
 from urllib3.util.retry import Retry
 
@@ -228,13 +229,13 @@ class BaseK8STest:
         result = {}
         # This loop retries until the DAG parser finishes with max_attempts 
and the DAG is available for execution.
         # Keep the try/catch block, as the session object has a default retry 
configuration.
-        # If a MaxRetryError is raised, it can be safely ignored, indicating 
that the DAG is not yet parsed.
+        # If a MaxRetryError, RetryError is raised, it can be safely ignored, 
indicating that the DAG is not yet parsed.
         while max_attempts:
             try:
                 result = self.session.patch(patch_string, json={"is_paused": 
False})
                 if result.status_code == 200:
                     break
-            except MaxRetryError:
+            except (MaxRetryError, RetryError):
                 pass
 
             time.sleep(30)

Reply via email to