Repository navigation
[Fix][Core] Fix test_runtime_env_image_uri and test_token_auth_integration on Windows - #66623
Merged
rueian merged 2 commits intoOct 2, 2026
Merged
Conversation
Signed-off-by: Chi-Sheng Liu <[email protected]>
MortalHappiness
marked this pull request as ready for review
October 1, 2026 20:16
Contributor
There was a problem hiding this comment.
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
approved these changes
Oct 1, 2026
rueian
enabled auto-merge (squash)
October 1, 2026 20:23
test_runtime_env_image_uri and test_token_auth_integration on Windows
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_filefails because theauth_envfixture redirects onlyHOME. On Windows,Path.home()readsUSERPROFILEand ignoresHOME, so the code looks for the real~/.ray/auth_tokenand never adds the mount. The fixture now setsUSERPROFILEtoo.//python/ray/tests:test_token_auth_integration: the file times out at themediumlimit (300s). Before [Fix][Core/Auth] Pass auth token to image_uri containers and reuse it whenray.init()finds a local cluster #66467 it already took 277-297s on Windows. [Fix][Core/Auth] Pass auth token to image_uri containers and reuse it whenray.init()finds a local cluster #66467 addedtest_ray_init_connect_reuses_existing_tokenwith 3 parameters, and each one runsray start --head, which pushes the file past the limit. This PR moves the file to thelargelist (900s).test_streaming_generator.pyis already there for the same reason.Related issues
Related to #66467.
Additional information
Both targets are now in the
FLAKYstate 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.test_runtime_env_image_uritest_token_auth_integration