Skip to content

[cherry-pick][2.60.0][Fix][Core] Fix test_runtime_env_image_uri and test_token_auth_integration on Windows (#66623) - #67213

Merged
elliot-barn merged 1 commit into
releases/2.60.0from
sai-miduthuri/cherry-pick-66623-2.60.0
Oct 21, 2026
Merged

elliot-barn merged 1 commit into
releases/2.60.0from
sai-miduthuri/cherry-pick-66623-2.60.0

Conversation

@sai-miduthuri

Copy link
Copy Markdown
Contributor

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 [Core] Log actor class import failures with their traceback #66564 added above it on master.

No prerequisite commits are missing:

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

…ation on Windows (#66623)

## Description

Two Windows tests have failed on every Windows postmerge build since
#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 #66467 it already took 277-297s on
Windows. #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 #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: #66637,
https://buildkite.com/ray-project/premerge/builds/74235
- master + fix: #66638,
https://buildkite.com/ray-project/premerge/builds/74236

Signed-off-by: Chi-Sheng Liu <[email protected]>
Co-authored-by: Mengjin Yan <[email protected]>
(cherry picked from commit 43cb165)
Signed-off-by: Sai Miduthuri <[email protected]>
@sai-miduthuri
sai-miduthuri requested a review from a team as a code owner October 20, 2026 21:26

@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 the test_token_auth_integration.py test to a larger shard in BUILD.bazel to prevent timeouts on Windows, and updates the auth_env fixture in test_runtime_env_image_uri.py to set the USERPROFILE environment variable for proper Windows compatibility. There are no review comments, and I have no feedback to provide.

@sai-miduthuri sai-miduthuri added the go add ONLY when ready to merge, run all tests label Oct 20, 2026
@ray-gardener ray-gardener Bot added windows core Issues that should be addressed in Ray Core release-test release test labels Oct 21, 2026
@sai-miduthuri
sai-miduthuri enabled auto-merge (squash) October 21, 2026 21:01
@elliot-barn
elliot-barn disabled auto-merge October 21, 2026 21:04
@elliot-barn
elliot-barn merged commit 9b6ee5e into releases/2.60.0 Oct 21, 2026
6 of 7 checks passed
@elliot-barn
elliot-barn deleted the sai-miduthuri/cherry-pick-66623-2.60.0 branch October 21, 2026 21:04
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 release-test release test windows

Development

Successfully merging this pull request may close these issues.

4 participants