-
Notifications
You must be signed in to change notification settings - Fork 346
test: handle invalid_grant in default creds system tests #1901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: handle invalid_grant in default creds system tests #1901
Conversation
This change updates the system tests for default credentials to explicitly allow "invalid_grant" errors when running with `authorized_user.json` credentials. This is because the CI environment uses credentials that frequently expire, and the server response for expired credentials has changed to return "invalid_grant", causing tests to fail instead of being suppressed as intended. This ensures the tests verify the library correctly handles the expiration error rather than failing. References: https://github.com/googleapis/google-auth-library-python/issues/1882
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
|
Example of test failure: |
Acknowledged. The provided failure log confirms that the server is returning |
This change updates the system tests for default credentials to explicitly allow "invalid_grant" errors when running with `authorized_user.json` credentials. This is because the CI environment uses credentials that frequently expire, and the server response for expired credentials has changed to return "invalid_grant", causing tests to fail instead of being suppressed as intended. This ensures the tests verify the library correctly handles the expiration error rather than failing. References: https://github.com/googleapis/google-auth-library-python/issues/1882
chalmerlowe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Updated
system_tests/system_tests_sync/test_default.pyandsystem_tests/system_tests_async/test_default.pyto catchRefreshErrorand check for "invalid_grant" in the error message when running withauthorized_user.jsoncredentials. This allows the test to pass by confirming the library correctly received the error from the server, acknowledging that the CI credentials are often stale.This builds on @daniel-sanche' work in PR #1883.
Recent changes to
mainappear to have adjusted the response values in these tests and was leading to them failing during CI/CD presubmit tests (see example below). This update now prevents those failing tests.PR created automatically by Jules for task 5370487295365926138 started by @chalmerlowe