Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions google/genai/tests/pytest_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ def base_test_function(
assert False, 'Should have raised exception in Vertex.'
client._api_client.close()
except Exception as e:
# Gracefully skip the test if we hit a live API quota limit
if getattr(e, 'code', None) == 429 and getattr(client._api_client, '_mode', None) == 'api':
pytest.skip(
'Resource Exhausted (429). Skipping test instead of'
f' failing: {e}'
)

if test_table_item.exception_if_mldev and not client._api_client.vertexai:
if test_table_item.exception_if_mldev not in str(e):
raise AssertionError(
Expand Down
18 changes: 18 additions & 0 deletions google/genai/tests/shared/models/test_generate_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
parameters=types._GenerateVideosParameters(
model=VEO_MODEL_LATEST_VERTEX,
prompt="Man with a dog",
config=types.GenerateVideosConfig(
http_options=types.HttpOptions(
retry_options=types.HttpRetryOptions(
attempts=2,
initial_delay=10.0,
http_status_codes=[429, 500, 502, 503, 504],
),
),
),
),
exception_if_mldev=(
"models/veo-3.1-lite-generate-001 is not found for API version v1beta"
Expand All @@ -38,6 +47,15 @@
parameters=types._GenerateVideosParameters(
model=VEO_MODEL_LATEST_GEMINI,
prompt="Man with a dog",
config=types.GenerateVideosConfig(
http_options=types.HttpOptions(
retry_options=types.HttpRetryOptions(
attempts=2,
initial_delay=10.0,
http_status_codes=[429, 500, 502, 503, 504],
),
),
),
),
exception_if_vertex=(
"404 NOT_FOUND"
Expand Down
Loading