Skip to content

chore: Fix the long running test cases#2239

Merged
copybara-service[bot] merged 1 commit into
mainfrom
copybara/788463914
Jul 29, 2025
Merged

chore: Fix the long running test cases#2239
copybara-service[bot] merged 1 commit into
mainfrom
copybara/788463914

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Jul 29, 2025

Copy link
Copy Markdown

chore: Fix the long running test cases
The test test_token_exchange_not_supported was slow because of an incorrect monkeypatch target. The test was patching google.adk.auth.auth_handler.AUTHLIB_AVAILABLE, but the actual OAuth2 exchange logic uses a different AUTHLIB_AVAILABLE variable in google.adk.auth.exchanger.oauth2_credential_exchanger.
What was happening:
Test set auth_handler.AUTHLIB_AVAILABLE = False
AuthHandler.exchange_auth_token() called OAuth2CredentialExchanger.exchange()
But oauth2_credential_exchanger.AUTHLIB_AVAILABLE was still True
The exchanger attempted real OAuth2 token exchange with client.fetch_token()
This made actual network calls to OAuth2 endpoints, causing timeouts and delays

@copybara-service
copybara-service Bot force-pushed the copybara/788463914 branch 5 times, most recently from f1f3956 to dcef3d7 Compare July 29, 2025 20:10
The test test_token_exchange_not_supported was slow because of an incorrect monkeypatch target. The test was patching google.adk.auth.auth_handler.AUTHLIB_AVAILABLE, but the actual OAuth2 exchange logic uses a different AUTHLIB_AVAILABLE variable in google.adk.auth.exchanger.oauth2_credential_exchanger.
What was happening:
Test set auth_handler.AUTHLIB_AVAILABLE = False
AuthHandler.exchange_auth_token() called OAuth2CredentialExchanger.exchange()
But oauth2_credential_exchanger.AUTHLIB_AVAILABLE was still True
The exchanger attempted real OAuth2 token exchange with client.fetch_token()
This made actual network calls to OAuth2 endpoints, causing timeouts and delays

PiperOrigin-RevId: 788576949
@copybara-service
copybara-service Bot force-pushed the copybara/788463914 branch from dcef3d7 to 2f73cfd Compare July 29, 2025 20:14
@copybara-service
copybara-service Bot merged commit 2f73cfd into main Jul 29, 2025
@copybara-service
copybara-service Bot deleted the copybara/788463914 branch July 29, 2025 20:14
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