From 83d37a677a30ead7696f09271f3e8036ee7bbafd Mon Sep 17 00:00:00 2001 From: zhuwenxing Date: Fri, 15 Sep 2023 15:53:26 +0800 Subject: [PATCH] [skip e2e]Add retry when getting image tag from dockerhub (#27107) Signed-off-by: zhuwenxing --- tests/python_client/requirements.txt | 1 + tests/scripts/get_image_tag_by_short_name.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/python_client/requirements.txt b/tests/python_client/requirements.txt index 446712fee2..821a723da7 100644 --- a/tests/python_client/requirements.txt +++ b/tests/python_client/requirements.txt @@ -44,6 +44,7 @@ loguru==0.7.0 # util psutil==5.9.4 pandas==1.5.3 +tenacity==8.1.0 # for standby test etcd-sdk-python==0.0.2 diff --git a/tests/scripts/get_image_tag_by_short_name.py b/tests/scripts/get_image_tag_by_short_name.py index f04e64a91a..5ee2101554 100644 --- a/tests/scripts/get_image_tag_by_short_name.py +++ b/tests/scripts/get_image_tag_by_short_name.py @@ -1,6 +1,8 @@ import requests import argparse +from tenacity import retry, stop_after_attempt +@retry(stop=stop_after_attempt(7)) def get_image_tag_by_short_name(repository, tag): # Send API request to get all tags start with prefix