Skip to content

Commit 080fa86

Browse files
committed
Retry transient summary requests and skip signed states
1 parent 71ec239 commit 080fa86

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

tests/mock_vws/test_database_summary.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from mock_vws import MockVWS
1818
from mock_vws.database import CloudDatabase
19+
from tests.mock_vws.utils.retries import TRANSIENT_VWS_EXCEPTIONS
1920

2021
LOGGER = logging.getLogger(name=__name__)
2122
LOGGER.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
)
4548
def _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

tests/mock_vws/test_model_target_web_api.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,11 +1669,10 @@ def test_state_based_dataset(
16691669
"""State-Based Model Target fields survive a dataset round
16701670
trip.
16711671
"""
1672-
if dataset_path == "/modeltargets/advancedDatasets":
1673-
_skip_unrequested_real_signing(
1674-
request=request,
1675-
backend=verify_model_target_mock_vuforia,
1676-
)
1672+
_skip_unrequested_real_signing(
1673+
request=request,
1674+
backend=verify_model_target_mock_vuforia,
1675+
)
16771676
body = {
16781677
**_UNAUTHENTICATED_DATASET_REQUEST,
16791678
"models": [

0 commit comments

Comments
 (0)