This is an automated email from the ASF dual-hosted git repository.
potiuk 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 8a4e7bda845 update k8s tests urllib3 retry config status_forcelist and
allowed_methods (#42871)
8a4e7bda845 is described below
commit 8a4e7bda845bab4dfe33af0a8b0c9e6fcf0da9f3
Author: GPK <[email protected]>
AuthorDate: Wed Oct 9 21:54:19 2024 +0100
update k8s tests urllib3 retry config status_forcelist and allowed_methods
(#42871)
---
kubernetes_tests/test_base.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/kubernetes_tests/test_base.py b/kubernetes_tests/test_base.py
index 0f5b673db2f..ac311daa52f 100644
--- a/kubernetes_tests/test_base.py
+++ b/kubernetes_tests/test_base.py
@@ -123,7 +123,12 @@ class BaseK8STest:
def _get_session_with_retries(self):
session = requests.Session()
session.auth = ("admin", "admin")
- retries = Retry(total=3, backoff_factor=1)
+ retries = Retry(
+ total=3,
+ backoff_factor=1,
+ status_forcelist=[404],
+ allowed_methods=Retry.DEFAULT_ALLOWED_METHODS |
frozenset(["PATCH", "POST"]),
+ )
session.mount("http://", HTTPAdapter(max_retries=retries))
session.mount("https://", HTTPAdapter(max_retries=retries))
return session