Skip to content

[serve] Deflake serve windows tests - #63281

Merged
abrarsheikh merged 1 commit into
masterfrom
deflake-serve-windows-tests
May 14, 2026
Merged

abrarsheikh merged 1 commit into
masterfrom
deflake-serve-windows-tests

Conversation

@jeffreywang88

@jeffreywang88 jeffreywang88 commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

Attempt to fix serve's windows flaky tests.

Most failures raise the same exception from python/ray/_private/node.py (example):

The current node timed out during startup...

GCS client polls GCS once per second for raylet_start_wait_time_s (default 30 s) and raises if the raylet hasn't registered. The retry log line Failed to get node info ... node registration may not be complete yet before the timeout. Try increase the RAY_raylet_start_wait_time_s config. shows up consistently across failed tests.

while (true) {
rpc::GetAllNodeInfoRequest::NodeSelector selector;
selector.set_node_id(node_id_binary);
{
absl::ReaderMutexLock lock(&mutex_);
auto timeout_ms =
std::max(end_time_point - current_time_ms(), static_cast<int64_t>(0));
RAY_ASSIGN_OR_RETURN(
node_infos,
gcs_client_->Nodes().GetAllNoCache(
timeout_ms, rpc::GcsNodeInfo::ALIVE, {std::move(selector)}));
}
if (!node_infos.empty()) {
*node_info = node_infos[0].SerializeAsString();
return Status::OK();
}

The current --parallelism-per-worker 3 command line argument spawns three docker containers concurrently within one Windows VM. Each container runs its own ray.init(), launching raylet + GCS + plasma + dashboard + log-monitor + runtime-env-agent.

Hypothesis: Windows pays more per ray.init() because it has no fork() (every helper re-imports via spawn + CreateProcess), DLL load goes through AV scan, and the raylet binary is on a network-mounted bazel runfiles tree. Linux absorbs 3-way contention in <30 s; Windows doesn't.

Related issues

Link related issues: "Fixes #1234", "Closes #1234", or "Related to #1234".

Additional information

Optional: Add implementation details, API changes, usage examples, screenshots, etc.

Signed-off-by: Jeffrey Wang <[email protected]>
@jeffreywang88
jeffreywang88 requested a review from abrarsheikh May 11, 2026 20:56
@jeffreywang88 jeffreywang88 added the go add ONLY when ready to merge, run all tests label May 11, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 reduces the parallelism per worker from 3 to 1 in the Windows CI configuration to mitigate resource contention. Feedback suggests further improving test robustness by increasing the RAY_raylet_start_wait_time_s timeout to 120 seconds to account for slow node registration on Windows.

--test-env=RAY_CI_POST_WHEEL_TESTS="1"
--test-env=USERPROFILE
--workers "$${BUILDKITE_PARALLEL_JOB_COUNT}" --worker-id "$${BUILDKITE_PARALLEL_JOB}" --parallelism-per-worker 3
--workers "$${BUILDKITE_PARALLEL_JOB_COUNT}" --worker-id "$${BUILDKITE_PARALLEL_JOB}" --parallelism-per-worker 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While reducing parallelism helps mitigate resource contention, Windows nodes can still experience slow startup times even in isolation. As noted in the PR description and the error logs, increasing the RAY_raylet_start_wait_time_s timeout would provide an additional layer of robustness against flakiness during node registration. Consider adding this environment variable to the test environment.

        --workers "$${BUILDKITE_PARALLEL_JOB_COUNT}" --worker-id "$${BUILDKITE_PARALLEL_JOB}" --parallelism-per-worker 1
        --test-env=RAY_raylet_start_wait_time_s="120"

@abrarsheikh abrarsheikh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i have attempted this in the past and that has not worked. I suggest running the windown test step like 5 times to confirm before merging

@jeffreywang88

Copy link
Copy Markdown
Contributor Author

@abrarsheikh Hmm interesting, kicking off windows tests now.

@ray-gardener ray-gardener Bot added the serve Ray Serve Related Issue label May 12, 2026
@abrarsheikh
abrarsheikh merged commit f665a23 into master May 14, 2026
4 checks passed
@abrarsheikh
abrarsheikh deleted the deflake-serve-windows-tests branch May 14, 2026 22:57
TruongQuangPhat pushed a commit to cyhapun/ray-fix-issue that referenced this pull request May 27, 2026
## Description
Attempt to fix serve's windows flaky tests.

Most failures raise the same exception from
`python/ray/_private/node.py`
([example](https://buildkite.com/ray-project/postmerge/builds/17496/canvas?jid=019e157b-bea4-4918-8075-86e9396a89e4&tab=output)):
```
The current node timed out during startup...
```

GCS client polls GCS once per second for `raylet_start_wait_time_s`
(default 30 s) and raises if the raylet hasn't registered. The retry log
line `Failed to get node info ... node registration may not be complete
yet before the timeout. Try increase the RAY_raylet_start_wait_time_s
config.` shows up consistently across failed tests.

https://github.com/ray-project/ray/blob/c01dcdefbefa123ba8766e1d90c00588f59026bb/src/ray/gcs_rpc_client/global_state_accessor.cc#L421-L436

The current `--parallelism-per-worker 3` command line argument spawns
three docker containers concurrently within one Windows VM. Each
container runs its own `ray.init()`, launching raylet + GCS + plasma +
dashboard + log-monitor + runtime-env-agent.

**Hypothesis**: Windows pays more per `ray.init()` because it has no
`fork()` (every helper re-imports via spawn + CreateProcess), DLL load
goes through AV scan, and the raylet binary is on a network-mounted
bazel runfiles tree. Linux absorbs 3-way contention in <30 s; Windows
doesn't.

## Related issues
> Link related issues: "Fixes ray-project#1234", "Closes ray-project#1234", or "Related to
ray-project#1234".

## Additional information
> Optional: Add implementation details, API changes, usage examples,
screenshots, etc.

Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: phattruong <[email protected]>
alexandrplashchinsky pushed a commit to alexandrplashchinsky/ray-alex that referenced this pull request May 29, 2026
## Description
Attempt to fix serve's windows flaky tests.

Most failures raise the same exception from
`python/ray/_private/node.py`
([example](https://buildkite.com/ray-project/postmerge/builds/17496/canvas?jid=019e157b-bea4-4918-8075-86e9396a89e4&tab=output)):
```
The current node timed out during startup...
```

GCS client polls GCS once per second for `raylet_start_wait_time_s`
(default 30 s) and raises if the raylet hasn't registered. The retry log
line `Failed to get node info ... node registration may not be complete
yet before the timeout. Try increase the RAY_raylet_start_wait_time_s
config.` shows up consistently across failed tests.

https://github.com/ray-project/ray/blob/c01dcdefbefa123ba8766e1d90c00588f59026bb/src/ray/gcs_rpc_client/global_state_accessor.cc#L421-L436

The current `--parallelism-per-worker 3` command line argument spawns
three docker containers concurrently within one Windows VM. Each
container runs its own `ray.init()`, launching raylet + GCS + plasma +
dashboard + log-monitor + runtime-env-agent.

**Hypothesis**: Windows pays more per `ray.init()` because it has no
`fork()` (every helper re-imports via spawn + CreateProcess), DLL load
goes through AV scan, and the raylet binary is on a network-mounted
bazel runfiles tree. Linux absorbs 3-way contention in <30 s; Windows
doesn't.

## Related issues
> Link related issues: "Fixes ray-project#1234", "Closes ray-project#1234", or "Related to
ray-project#1234".

## Additional information
> Optional: Add implementation details, API changes, usage examples,
screenshots, etc.

Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Alexandr Plashchinsky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ray fails to serialize self-reference objects

2 participants