Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions release/ray_release/buildkite/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ def get_step(
if smoke_test:
cmd += ["--smoke-test"]

num_retries = test.get("run", {}).get("num_retries")
Copy link
Collaborator

Choose a reason for hiding this comment

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

unit test?

if num_retries:
Copy link
Contributor

Choose a reason for hiding this comment

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

high

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.

Suggested change
if num_retries:
if num_retries is not None:

step["retry"]["automatic"][0]["limit"] = num_retries
Copy link

Choose a reason for hiding this comment

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

Bug: Retry Logic Fails When Zero Retries Specified

The if num_retries: condition evaluates to False when num_retries is 0, preventing tests from explicitly disabling retries. This results in default retry behavior instead of the intended zero retries.

Fix in Cursor Fix in Web


step["plugins"][0][DOCKER_PLUGIN_KEY]["command"] = cmd

env_to_use = test.get("env", DEFAULT_ENVIRONMENT)
Expand Down
3 changes: 3 additions & 0 deletions release/ray_release/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
},
"artifact_path": {
"type": "string"
},
"num_retries": {
"type": "integer"
}
},
"required": [
Expand Down
1 change: 1 addition & 0 deletions release/release_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@

run:
timeout: 1800
num_retries: 3
script: python hello_world.py

variations:
Expand Down