GKE code executor unit tests fail with kubernetes 37.0.0, turning main CI red
メンテナーはふだん 5 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
調査の方向性
まず tests/unittests/code_executors/test_gke_code_executor.py を確認し、失敗している5つのテストで create_namespaced_job がどのようにモックされているかを調べます。kubernetes 37.0.0 で指定された pytest コマンドを実行し、モックの戻り値を _add_owner_reference が使用する実際の V1Job フィールドと比較します。kubernetes 36.0.3 と 37.0.0 の両方で18個すべてのテストが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
🔴 Required Information
Describe the Bug:
Since kubernetes 37.0.0 was published to PyPI (2026-10-07, 00:51 UTC), five tests in tests/unittests/code_executors/test_gke_code_executor.py fail. The Unit Tests jobs of the Continuous Integration workflow have failed on main for Python 3.11–3.14 on every push since 51a20e24, because CI installs the newest version kubernetes>=29 allows.
kubernetes 37 validates model fields with pydantic. In these tests create_namespaced_job returns the default MagicMock, and GkeCodeExecutor._add_owner_reference copies that Job's api_version, kind, metadata.name and metadata.uid into a V1OwnerReference, which now raises a ValidationError. execute_code catches it and returns "An unexpected executor error occurred", so the assertions fail.
Only the tests are affected. Against a real cluster, create_namespaced_job returns a V1Job with string fields. The other 13 tests in the file pass on 37.0.0, including the one that builds a real Job manifest.
Steps to Reproduce:
pip install -e . pytest pytest-asyncio pytest-mock "kubernetes==37.0.0"pytest tests/unittests/code_executors/test_gke_code_executor.py
Expected Behavior:
All 18 tests pass, as they do with kubernetes 36.0.3 (the version pinned in constraints-3.*.txt).
Observed Behavior:
FAILED ...::test_execute_code_success - AssertionError: assert '' == 'hello world'
FAILED ...::test_execute_code_job_failed - assert 'Job failed. Logs:' in "An unexpected executor error occurred: 4 validation errors for V1OwnerReference ..."
FAILED ...::test_execute_code_job_failed_without_terminated_container - assert None == 1
FAILED ...::test_execute_code_timeout - assert 'Executor timed out' in "An unexpected executor error occurred: 4 validation errors for V1OwnerReference ..."
FAILED ...::test_execute_code_forks_to_job - AssertionError: assert '' == 'job stdout'
5 failed, 13 passed
The underlying error:
4 validation errors for V1OwnerReference
api_version
Input should be a valid string [type=string_type, input_value=<MagicMock name='mock.api...ersion' id='...'>, input_type=MagicMock]
kind
Input should be a valid string [type=string_type, input_value=<MagicMock name='mock.kind' id='...'>, input_type=MagicMock]
name
Input should be a valid string [type=string_type, input_value=<MagicMock name='mock.met...a.name' id='...'>, input_type=MagicMock]
uid
Input should be a valid string [type=string_type, input_value=<MagicMock name='mock.met...ta.uid' id='...'>, input_type=MagicMock]
Environment Details:
- ADK Library Version:
main(2.11.0), since 51a20e24 - Desktop OS: Linux (GitHub Actions) and macOS
- Python Version: 3.11, 3.12, 3.13 and 3.14
Model Information:
- Are you using LiteLLM: N/A
- Which model is being used: N/A, no model is involved
🟡 Optional Information
Regression:
Yes, but the regression comes from the dependency release, not from an ADK commit. The same tests pass with kubernetes 36.0.3.
Logs:
CI run on main: https://github.com/google/adk-python/actions/runs/37674194847
Additional Context:
constraints-3.*.txt already pin kubernetes==36.0.3, but the unit test job installs without them. A fix that keeps the tests passing on both versions is to have the mocked create_namespaced_job return a real client.V1Job with string fields. I'll open a PR.
How often has this issue occurred?:
- Always (100%)
- 主要言語
- Python
- スター
- 21.8k
- フォーク
- 4.1k
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/adk-python のほかの issue
-
Update opentelemetry-api and opentelemetry-sdk to 1.44.0対応中かも @llalitkumarrr が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
google/adk-python#7433 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 5 日以内に返信
-
CI Mypy Check flags an existing streaming_utils.py error as new because the PR run reuses the baseline's mypy cache対応中かも @DeanChensj が 3 日前に担当しました。 オープンneeds review
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
google/adk-python#7409 · コメント 1 件 · 担当者 2 名 ·
メンテナーはふだん 5 日以内に返信
-
A2aAgentExecutor sends the raw exception text to the A2A caller when the run fails対応中かも @sanketpatil06 が 4 日前に担当しました。 オープンa2a request clarification
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
google/adk-python#7385 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 5 日以内に返信
-
Please support mermaid 12 (inbuild elk) in `adk web`対応中かも @sanketpatil06 が 4 日前に担当しました。 オープンneeds review web
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
google/adk-python#7381 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 5 日以内に返信
-
[A2A] RemoteA2aAgent(use_legacy=False): extension header written to state['http_kwargs'], ignored by a2a-sdk 1.x transports対応中かも @surajksharma07 が 10 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
google/adk-python#7334 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 5 日以内に返信
google/adk-python の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
MystenLabs/MemWal#1163 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
infertopics leaves new nodes without a topic when untopiced neighbours outnumber topiced ones対応中かも @moneebullah25 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
FinanceFlash/unvibecode#218 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
NVIDIA/earth2studio#1241 ·
メンテナーはふだん 3 日以内に返信