Skip to content

fix: account for operation polling timeout#2461

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

fix: account for operation polling timeout#2461
pragnyanramtha wants to merge 1 commit 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.

@pragnyanramtha
Copy link
Copy Markdown
Author

Refreshed this branch with current main and re-ran the focused validation.

Validation:

  • .venv/bin/python -m pytest google/genai/tests/transformers/test_t_operation.py -q -> 1 passed
  • .venv/bin/python -m pytest google/genai/tests/transformers/test_t_*.py -q -> 117 passed
  • .venv/bin/python -m py_compile google/genai/_transformers.py google/genai/tests/transformers/test_t_operation.py -> passed
  • git diff --check origin/main...HEAD -> passed

@pragnyanramtha pragnyanramtha force-pushed the pragnyan/fix-operation-poll-timeout branch from e77b542 to 66ca723 Compare May 21, 2026 06:22
@Venkaiahbabuneelam Venkaiahbabuneelam self-assigned this May 22, 2026
@Venkaiahbabuneelam Venkaiahbabuneelam added the size:L Code changes between 40-100 lines label May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L Code changes between 40-100 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants