Skip to content

Commit 646cce9

Browse files
authored
[ci] Separate Windows Serve tests into their own build (ray-project#40057)
The windows tests are quite flaky and take a long time to run. When I'm merging Serve PRs, I want to be able to quickly find and evaluate Serve-specific tests on Windows. This will help avoid introducing failures/flakiness.
1 parent 51d1ad8 commit 646cce9

File tree

2 files changed

+51
-6
lines changed

2 files changed

+51
-6
lines changed

.buildkite/pipeline.windows.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ upload_wheels_if_needed: &upload_wheels_if_needed |-
2828

2929

3030
steps:
31-
- label: ":windows: Build & Test"
32-
parallelism: 6
31+
- label: ":windows: Core + Python tests (excluding serve)"
32+
parallelism: 5
3333
commands:
3434
- *prelude_commands
3535
# conda init should be moved to the docker image setup
@@ -41,6 +41,18 @@ steps:
4141
# The next command will be sharded into $parallelism shards.
4242
- ./ci/ci.sh test_python
4343

44+
- label: ":windows: Serve tests"
45+
parallelism: 2
46+
commands:
47+
- *prelude_commands
48+
# conda init should be moved to the docker image setup
49+
- conda init
50+
- . ./ci/ci.sh init
51+
- ./ci/ci.sh build
52+
- export RAY_ENABLE_WINDOWS_OR_OSX_CLUSTER="1"
53+
# The next command will be sharded into $parallelism shards.
54+
- ./ci/ci.sh test_serve
55+
4456
- label: ":windows: Wheels"
4557
commands:
4658
- *prelude_commands

ci/ci.sh

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,13 @@ prepare_docker() {
206206
popd
207207
}
208208

209-
# For running Python tests on Windows.
210-
test_python() {
209+
# For running Serve tests on Windows.
210+
test_serve() {
211211
local pathsep=":" args=()
212212
if [ "${OSTYPE}" = msys ]; then
213213
pathsep=";"
214214
args+=(
215215
python/ray/serve/...
216-
python/ray/tests/...
217-
python/ray/train:test_windows
218216
-python/ray/serve/tests:test_cross_language # Ray java not built on Windows yet.
219217
-python/ray/serve/tests:test_gcs_failure # Fork not supported in windows
220218
-python/ray/serve/tests:test_standalone_2 # Multinode not supported on Windows
@@ -224,6 +222,41 @@ test_python() {
224222
-python/ray/serve/tests:test_fastapi
225223
-python/ray/serve/tests:test_get_deployment # address violation
226224
-python/ray/serve/tests:test_proxy_state # skip running on Windows until we refactor the test
225+
)
226+
fi
227+
if [ 0 -lt "${#args[@]}" ]; then # Any targets to test?
228+
install_ray
229+
230+
# Shard the args.
231+
BUILDKITE_PARALLEL_JOB=${BUILDKITE_PARALLEL_JOB:-'0'}
232+
BUILDKITE_PARALLEL_JOB_COUNT=${BUILDKITE_PARALLEL_JOB_COUNT:-'1'}
233+
test_shard_selection=$(python ./ci/ray_ci/bazel_sharding.py --exclude_manual --index "${BUILDKITE_PARALLEL_JOB}" --count "${BUILDKITE_PARALLEL_JOB_COUNT}" "${args[@]}")
234+
235+
# TODO(mehrdadn): We set PYTHONPATH here to let Python find our pickle5 under pip install -e.
236+
# It's unclear to me if this should be necessary, but this is to make tests run for now.
237+
# Check why this issue doesn't arise on Linux/Mac.
238+
# Ideally importing ray.cloudpickle should import pickle5 automatically.
239+
# shellcheck disable=SC2046,SC2086
240+
bazel test --config=ci \
241+
--build_tests_only $(./ci/run/bazel_export_options) \
242+
--test_env=PYTHONPATH="${PYTHONPATH-}${pathsep}${WORKSPACE_DIR}/python/ray/pickle5_files" \
243+
--test_env=CI="1" \
244+
--test_env=RAY_CI_POST_WHEEL_TESTS="1" \
245+
--test_env=USERPROFILE="${USERPROFILE}" \
246+
--test_output=streamed \
247+
-- \
248+
${test_shard_selection};
249+
fi
250+
}
251+
252+
# For running Python tests on Windows (excluding Serve).
253+
test_python() {
254+
local pathsep=":" args=()
255+
if [ "${OSTYPE}" = msys ]; then
256+
pathsep=";"
257+
args+=(
258+
python/ray/tests/...
259+
python/ray/train:test_windows
227260
-python/ray/tests:test_actor_advanced # crashes in shutdown
228261
-python/ray/tests:test_autoscaler # We don't support Autoscaler on Windows
229262
-python/ray/tests:test_autoscaler_aws

0 commit comments

Comments
 (0)