Skip to content

fix: account for operation polling timeout#2461

Open
pragnyanramtha wants to merge 3 commits into
googleapis:mainfrom
pragnyanramtha:pragnyan/fix-operation-poll-timeout
Open

fix: account for operation polling timeout#2461
pragnyanramtha wants to merge 3 commits into
googleapis:mainfrom
pragnyanramtha:pragnyan/fix-operation-poll-timeout

Conversation

@pragnyanramtha
Copy link
Copy Markdown

Summary

  • Fix long-running operation polling timeout accounting so pending operations eventually raise after the configured timeout.
  • Add a focused transformer unit test that catches the previous infinite-polling behavior without sleeping in real time.

Why

t_resolve_operation initialized total_seconds to 0.0 but updated it with total_seconds += total_seconds, which leaves it at zero forever. If an operation never reaches done: true, the timeout guard never fires.

Validation

  • .venv/bin/python -m pytest google/genai/tests/transformers/test_t_operation.py -q
  • .venv/bin/python -m pytest google/genai/tests/transformers/test_t_*.py -q
  • .venv/bin/python -m py_compile google/genai/_transformers.py google/genai/tests/transformers/test_t_operation.py
  • git diff --check

Note: pytest google/genai/tests/transformers -q could not collect in this local Python 3.14 environment because google/genai/tests/transformers/test_blobs.py imports PIL, and installing pinned Pillow==11.0.0 from requirements.txt failed due missing JPEG headers/no compatible wheel in this image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant