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
bug: add missing latency check #763
Conversation
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
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.
Removed two octothorpes.
noxfile.py
Outdated
@@ -347,17 +348,21 @@ def prerelease(session): | |||
session.run("python", "-m", "pip", "freeze") | |||
|
|||
# Run all tests, except a few samples tests which require extra dependencies. | |||
|
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.
nit: remove the added empty line?
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.
In this case, if it passes linting and black... I am fine with it being as it is.
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.
I'm not sure about this - if there isn't a good reason to change it, I don't think we should.
# API calls timing out before they can finish. | ||
# ~300 milliseconds is rule of thumb for bare minimum | ||
# latency from the BigQuery API. | ||
minimum_latency = 400 |
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.
Maybe we can define minimum_latency
as a constant at top of the file, for easy access and reuse in the future (see example).
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.
I would like to leave this as is.
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.
Could you explain why? Thank you.
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.
I don't see this particular variable being used widely throughout the code (now or in the future).
I appreciate having the variable and the comment about the variable close together and in this case close to where they are being used. I feel it improves the readability/maintainability of the code. Especially since this edit is in response to a flakybot failing test. If it continues to fail, then whoever troubleshoots this is likely to see the comment in situ and may then tweak the duration to better match real world conditions.
There is a failing flakybot test. This PR provides a possible mitigation.
During a recent PR, we appear to have introduced a situation that occurs when we attempt to perform certain actions without recognizing that there will be some latency in the system. This adds checks to account for that latency.
Fixes #762