GKE code executor unit tests fail with kubernetes 37.0.0, turning main CI red
I maintainer di solito rispondono entro 6 giorni
@vetler ci sta già lavorando.
Dal 7/10/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
Direzione di ricerca
Inizia da tests/unittests/code_executors/test_gke_code_executor.py e controlla come viene simulato create_namespaced_job nei cinque test non riusciti. Esegui il comando pytest indicato con kubernetes 37.0.0, quindi confronta il valore restituito dal mock con i campi effettivi di V1Job usati da _add_owner_reference. Il lavoro è completato quando tutti e 18 i test passano sia con kubernetes 36.0.3 sia con 37.0.0.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🔴 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%)
- Lingua principale
- Python
- Stelle
- 21.6k
- Fork
- 4k
- Merge medio
- 1g 13h
- PR unite (30g)
- 6
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/adk-python
-
after_model_callback: a replacement LlmResponse drops `usage_metadata`, erasing the model call from token accountingForse già presa @zhuhongd l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
google/adk-python#7451 ·
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
google/adk-python#7433 · 1 commento ·
I maintainer di solito rispondono entro 6 giorni
-
CI Mypy Check flags an existing streaming_utils.py error as new because the PR run reuses the baseline's mypy cacheForse già presa @DeanChensj l’ha presa 2 giorni fa. Apertaneeds review
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google/adk-python#7409 · 1 commento · 2 assegnatari ·
I maintainer di solito rispondono entro 6 giorni
-
A2aAgentExecutor sends the raw exception text to the A2A caller when the run failsForse già presa @sanketpatil06 l’ha presa 3 giorni fa. Apertaa2a request clarification
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
google/adk-python#7385 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 6 giorni
-
Please support mermaid 12 (inbuild elk) in `adk web`Forse già presa @sanketpatil06 l’ha presa 3 giorni fa. Apertaneeds review web
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
google/adk-python#7381 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 6 giorni
Tutte le issue di google/adk-python
Issue simili
-
Maven path-index: "Ambiguous or noncanonical artifact path" error does not report the offending pathAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
pulp/pulp_maven#524 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
infinispan/langchain-infinispan#34 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
521xueweihan/HelloGitHub#3891 ·