Skip to content

Commit e1a6a77

Browse files
khluuaslonnie
authored andcommitted
[release] Allow release test to specify num_retries (ray-project#57578)
So it can be configured for expensive tests to not retry --------- Signed-off-by: kevin <[email protected]> Co-authored-by: Lonnie Liu <[email protected]>
1 parent 5c7e75d commit e1a6a77

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

release/ray_release/buildkite/step.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ def get_step(
141141
if smoke_test:
142142
cmd += ["--smoke-test"]
143143

144+
num_retries = test.get("run", {}).get("num_retries")
145+
if num_retries:
146+
step["retry"]["automatic"][0]["limit"] = num_retries
147+
144148
step["plugins"][0][DOCKER_PLUGIN_KEY]["command"] = cmd
145149

146150
env_to_use = test.get("env", DEFAULT_ENVIRONMENT)

release/ray_release/schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@
159159
},
160160
"artifact_path": {
161161
"type": "string"
162+
},
163+
"num_retries": {
164+
"type": "integer"
162165
}
163166
},
164167
"required": [

release/ray_release/tests/test_step.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ def _stub_test(val: dict) -> Test:
2121
"cluster": {
2222
"byod": {},
2323
},
24+
"run": {
25+
"script": "python test.py",
26+
"timeout": 100,
27+
"num_retries": 3,
28+
},
2429
}
2530
)
2631
test.update(val)
@@ -32,6 +37,7 @@ def test_get_step(mock):
3237
with patch.dict("os.environ", {"RAYCI_BUILD_ID": "a1b2c3d4"}):
3338
step = get_step(_stub_test({}), run_id=2)
3439
assert step["label"] == "test (None) (2)"
40+
assert step["retry"]["automatic"][0]["limit"] == 3
3541

3642

3743
@patch("ray_release.test.Test.update_from_s3", return_value=None)

release/release_tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191

9292
run:
9393
timeout: 1800
94+
num_retries: 3
9495
script: python hello_world.py
9596

9697
variations:

0 commit comments

Comments
 (0)