8000 change iap assert order by leahecole · Pull Request #4515 · GoogleCloudPlatform/python-docs-samples · GitHub
[go: up one dir, main page]

Skip to content

change iap assert order #4515

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

Merged
merged 5 commits into from
Aug 19, 2020
Merged

change iap assert order #4515

merged 5 commits into from
Aug 19, 2020

Conversation

leahecole
Copy link
Collaborator

Description

Fixes #4467

Note: It's a good idea to open an issue first for discussion.

Checklist

@leahecole leahecole requested review from tmatsuo and engelke August 18, 2020 16:41
@leahecole leahecole requested a review from a team as a code owner August 18, 2020 16:41
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 18, 2020
iap/iap_test.py Outdated

assert 'JWT valdiation error' not in out
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that stdout contains the error message.

return (None, None, '**ERROR: JWT validation error {}**'.format(e))

It's returning a tuple and jwt_validation_result[2] has the error message.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to descr 10000 ibe this comment to others. Learn more.

Those two lines are wrong. It looks like they were put in by the merge with master. I'll take them back out.

@tmatsuo
Copy link
Contributor
tmatsuo commented Aug 18, 2020

So now this PR doesn't have any changes? I'm not sure if it will solve the original issue.

@engelke
Copy link
Contributor
engelke commented Aug 18, 2020

I can't tell from the original issue whether this test really is flaky, or if it was a one-time thing. I can't find other failures of this test. There may be nothing to solve.

@leahecole
Copy link
Collaborator Author

Lol alright - I trust you @engelke - I was mostly guessing

@leahecole
Copy link
Collaborator Author

@engelke if flaky, is it obvious what the underlying assertion is that we could potentially use with the backoff library?

@engelke
Copy link
Contributor
engelke commented Aug 18, 2020

There are only two ways I can see for this to fail. First, if the app at gcp-devrel-iap-reflect.appspot.com doesn't return the correct response, or if the URL for the validation certs doesn't return the right certs. I guess the metadata service could also fail to return a valid token when asked. I'd guess the reflection appspot app might be a bit more likely to have a problem, perhaps due to a very slow startup once in a while.

It's hard to see how to fix it without just rerunning the whole test.

@tmatsuo
Copy link
Contributor
tmatsuo commented Aug 19, 2020

My guess is that the code throws an exception. More problematically, the test code is throwing away the error, by asserting the first element of the tuple.

My suggestion is that, first we need to log the error.

@leahecole leahecole changed the title capture error, assert error string not in out change iap assert order Aug 19, 2020
@tmatsuo
Copy link
Contributor
tmatsuo commented Aug 19, 2020

I don't think we need to "Update branch", feel free to merge. Also feel free to "Update branch" then merge :)

@engelke engelke merged commit e4ff0ef into master Aug 19, 2020
@engelke engelke deleted the fix-iap branch August 19, 2020 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iap.iap_test: test_main failed
3 participants
0