Skip to content

[Fix][Core] Fix test_runtime_env_image_uri and test_token_auth_integration on Windows - #66623

Merged
rueian merged 2 commits into
ray-project:masterfrom
MortalHappiness:fix/core-windows-test-2-60
Oct 2, 2026
Merged

rueian merged 2 commits into
ray-project:masterfrom
MortalHappiness:fix/core-windows-test-2-60

Conversation

@MortalHappiness

@MortalHappiness MortalHappiness commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Description

Two Windows tests have failed on every Windows postmerge build since #66467 (builds 20012, 20016, 20026 and 20040). This PR fixes both.

Related issues

Related to #66467.

Additional information

Both targets are now in the FLAKY state in the CI test database, so the regular premerge jobs on this PR skip them. To check the fix, I ran each target 3 times on Windows premerge, once on master and once on master plus this fix, with retries off and the test database lookup bypassed.

Target master master + this PR
test_runtime_env_image_uri 3/3 failed (same assertion as postmerge) 0/3 failed
test_token_auth_integration 3/3 timed out at 300s 0/3 failed, 324-345s per run

Signed-off-by: Chi-Sheng Liu <[email protected]>
@MortalHappiness MortalHappiness added the go add ONLY when ready to merge, run all tests label Oct 1, 2026
@MortalHappiness MortalHappiness changed the title [WIP] [Fix][Core] Fix test_runtime_env_image_uri and test_token_auth_integration on Windows Oct 1, 2026
@MortalHappiness
MortalHappiness marked this pull request as ready for review October 1, 2026 20:16
@MortalHappiness
MortalHappiness requested a review from a team as a code owner October 1, 2026 20:16

@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 moves test_token_auth_integration.py to a larger shard in the Bazel build configuration to prevent timeouts on Windows. Additionally, it updates the auth_env fixture in test_runtime_env_image_uri.py to set the USERPROFILE environment variable, ensuring compatibility with Windows where Path.home() ignores HOME. There are no review comments to address.

@rueian
rueian enabled auto-merge (squash) October 1, 2026 20:23
@MortalHappiness MortalHappiness changed the title [Fix][Core] Fix test_runtime_env_image_uri and test_token_auth_integration on Windows [Fix][Core] Fix test_runtime_env_image_uri and test_token_auth_integration on Windows Oct 1, 2026
@ray-gardener ray-gardener Bot added the core Issues that should be addressed in Ray Core label Oct 2, 2026
@rueian
rueian merged commit 43cb165 into ray-project:master Oct 2, 2026
7 checks passed
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ation on Windows (ray-project#66623)

## Description

Two Windows tests have failed on every Windows postmerge build since
ray-project#66467 (builds 20012, 20016, 20026 and 20040). This PR fixes both.

- `//python/ray/tests/unit:test_runtime_env_image_uri`:
`test_mounts_default_token_file` fails because the `auth_env` fixture
redirects only `HOME`. On Windows, `Path.home()` reads `USERPROFILE` and
ignores `HOME`, so the code looks for the real `~/.ray/auth_token` and
never adds the mount. The fixture now sets `USERPROFILE` too.
- `//python/ray/tests:test_token_auth_integration`: the file times out
at the `medium` limit (300s). Before ray-project#66467 it already took 277-297s on
Windows. ray-project#66467 added `test_ray_init_connect_reuses_existing_token` with
3 parameters, and each one runs `ray start --head`, which pushes the
file past the limit. This PR moves the file to the `large` list (900s).
`test_streaming_generator.py` is already there for the same reason.

## Related issues

Related to ray-project#66467.

## Additional information

Both targets are now in the `FLAKY` state in the CI test database, so
the regular premerge jobs on this PR skip them. To check the fix, I ran
each target 3 times on Windows premerge, once on master and once on
master plus this fix, with retries off and the test database lookup
bypassed.

| Target | master | master + fix |
| --- | --- | --- |
| `test_runtime_env_image_uri` | 3/3 failed (same assertion as
postmerge) | 0/3 failed |
| `test_token_auth_integration` | 3/3 timed out at 300s | 0/3 failed,
324-345s per run |

- master: ray-project#66637,
https://buildkite.com/ray-project/premerge/builds/74235
- master + fix: ray-project#66638,
https://buildkite.com/ray-project/premerge/builds/74236

Signed-off-by: Chi-Sheng Liu <[email protected]>
Co-authored-by: Mengjin Yan <[email protected]>
elliot-barn pushed a commit that referenced this pull request Oct 21, 2026
… `test_token_auth_integration` on Windows (#66623) (#67213)

Cherry-pick of #66623 (master commit
43cb165) onto `releases/2.60.0`.

## Why

Both tests fail in the `:ray: core: :windows: python tests` job in all
11 `releases/2.60.0` postmerge builds so far, including build 20362 for
the current branch head:

- `test_runtime_env_image_uri.py::test_mounts_default_token_file` fails
its token-mount assertion. The `auth_env` fixture redirects only `HOME`,
but on Windows `Path.home()` reads `USERPROFILE`.
- `test_token_auth_integration` times out at the 300s `medium` limit.

Both failures started with #66467, which this branch has. #66623 sets
`USERPROFILE` in the fixture and moves `test_token_auth_integration.py`
to the `large` list (900s). It changes only tests and `BUILD.bazel`.

On master, both tests failed in every release-automation postmerge build
that ran them, from the branch point through build 20097. They have
passed in all 49 builds that ran them since build 20102, the first to
include #66623.

## Cherry-pick details

Applied cleanly with `git cherry-pick -x`. The change is identical to
the master commit:

- Same 2 files, 5 insertions and 1 deletion, and the same `git patch-id
--stable`.
- The diff text matches except for the second `BUILD.bazel` hunk header.
It starts 1 line earlier here, because this branch doesn't have the
`test_function_manager_import_error.py` entry that #66564 added above it
on master.

No prerequisite commits are missing:

- On master, only #66564 touched these files between the branch cut and
#66623. It added that one test entry to another list.
- After the pick, `test_runtime_env_image_uri.py` is identical to master
at 43cb165, and `BUILD.bazel` differs only by that entry.
- `test_token_auth_integration.py` is now in the same `large` list as on
master (tag `large_size_python_tests_shard_0`). The separate
`_client_mode` entry was already `large` and is unchanged.
- On this branch, no commit after the cut touched these files.

Not a duplicate: this branch doesn't contain #66623, and no PR against
`releases/2.60.0` references it.

## Testing

| Command | Result |
|---|---|
| `pre-commit run --files python/ray/tests/BUILD.bazel
python/ray/tests/unit/test_runtime_env_image_uri.py` | Passed (ruff,
black, buildifier, buildifier-lint, and the other applicable hooks) |

Both fixes only change behavior on Windows, so I didn't run the tests
locally on Linux. In CI they run in the `:ray: core: :windows: python
tests` job. On premerge and microcheck, that job waits on the "run
windows tests" block step.

AI assistance was used to prepare this cherry-pick.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Chi-Sheng Liu <[email protected]>
Signed-off-by: Sai Miduthuri <[email protected]>
Co-authored-by: Chi-Sheng Liu <[email protected]>
Co-authored-by: Mengjin Yan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants