-
Notifications
You must be signed in to change notification settings - Fork 6.9k
[release] Allow release test to specify num_retries #57578
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
base: master
Are you sure you want to change the base?
Conversation
|
||
num_retries = test.get("run", {}).get("num_retries") | ||
if num_retries: | ||
step["retry"]["automatic"][0]["limit"] = num_retries |
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.
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.
Code Review
This pull request introduces a useful feature to configure the number of retries for release tests. The implementation is straightforward, but I've found one important issue in the logic that handles the num_retries
value. Please see my comment below.
cmd += ["--smoke-test"] | ||
|
||
num_retries = test.get("run", {}).get("num_retries") | ||
if num_retries: |
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.
The condition if num_retries:
will evaluate to False
when num_retries
is 0
. This prevents disabling retries for a test by setting num_retries: 0
, which is a key use case mentioned in the PR description ("to not retry"). When num_retries
is 0, the default retry limit (likely 1) will be used instead of disabling retries.
To correctly handle the case where num_retries
is 0
, you should check if the value is not None
.
if num_retries: | |
if num_retries is not None: |
if smoke_test: | ||
cmd += ["--smoke-test"] | ||
|
||
num_retries = test.get("run", {}).get("num_retries") |
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.
unit test?
So it can be configured for expensive tests to not retry