1616
1717from mock_vws import MockVWS
1818from mock_vws .database import CloudDatabase
19+ from tests .mock_vws .utils .retries import TRANSIENT_VWS_EXCEPTIONS
1920
2021LOGGER = logging .getLogger (name = __name__ )
2122LOGGER .setLevel (level = logging .DEBUG )
@@ -39,7 +40,9 @@ def _log_attempt_number(retry_state: RetryCallState) -> None:
3940 # expected number. This is necessary because the database summary endpoint
4041 # lags behind the real data.
4142 stop = stop_after_delay (max_delay = 700 ),
42- retry = retry_if_exception_type (exception_types = (AssertionError ,)),
43+ retry = retry_if_exception_type (
44+ exception_types = (AssertionError , * TRANSIENT_VWS_EXCEPTIONS ),
45+ ),
4346 before = _log_attempt_number ,
4447)
4548def _wait_for_image_numbers (
@@ -61,8 +64,10 @@ def _wait_for_image_numbers(
6164 processing_images: The expected number of processing images.
6265
6366 Raises:
64- ValueError: The numbers of images in various categories do not match
65- within the time limit.
67+ AssertionError: The numbers of images in various categories do not
68+ match within the time limit.
69+ requests.exceptions.RequestException: The real service remains
70+ unavailable for the full retry period.
6671 """
6772 database_summary_report = vws_client .get_database_summary_report ()
6873
0 commit comments