browser test: wait for token request to finish before reloading #4618
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this may be the cause of flaky tests where there are no tokens to list
This might fix failures like this one in
test_revoke_token[request_by_user]
:where the failure suggests that the token wasn't actually requested, and the logs appear to confirm that the request for a new token is not received by the server. My hunch is that awaiting the button click doesn't await the resulting fetch, and reloading the page prevents it from actually firing. A second option is that the javascript click event isn't hooked up before we trigger the click, so clicking doesn't do anything.