Repository navigation
[Test] Match managed-job GCP instances on the name prefix that survives truncation - #10809
Merged
Merged
Conversation
…es truncation The GCP managed-job smoke tests locate the job's VMs with `gcloud compute instances list --filter="labels.ray-cluster-name:<name>"`, where <name> is the job name truncated to JOBS_CLUSTER_NAME_PREFIX_LENGTH. The controller launches the cluster as `<name>-<job_id>`, and the GCP provisioner then applies make_cluster_name_on_cloud with GCP's 35-char limit, which cuts the display name to 23 chars and appends `-<2-char hash>-<8-char user hash>`. Since #10396 widened test_id to four chars, get_cluster_name() yields 24- to 25-char names, so the job id and the tail of the name are cut off and the `:` (word-prefix) filter never matches. The `gcloud compute instances delete $(...)` then runs with no instance and exits 2: test_managed_jobs_recovery_multi_node_gcp: name 't-jobs-recovery-m-42-3617' (25 chars) -> cluster 't-jobs-recovery-m-42-36-8v-2cf7a762'. Fails on every run. Seen in smoke-tests build 13078 (3/3 attempts) after the job had reached RUNNING. test_managed_jobs_recovery_gcp / test_managed_jobs_cancellation_gcp: 24-char names fit for single-digit job ids and break once the controller reaches job id 10. Add smoke_tests_utils.get_managed_job_cluster_name_prefix_on_gcp(), which mirrors the production naming and returns the leading 35 - 2 - 1 - 9 = 23 chars of the display name (computed from the library constants), and filter on that in the three GCP tests. The prefix still carries the first two chars of test_id, the same entropy the filter had before #10396. AWS tests already use a `Values=<name>*` wildcard and AWS has no 35-char limit, so they are unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Collaborator
Author
|
/smoke-test --gcp -k "test_managed_jobs_recovery_gcp or test_managed_jobs_cancellation_gcp" |
Collaborator
Author
Validation
Before the fix the multi-node test failed 3/3 attempts in 13078 at the terminate step with the job already RUNNING. Also confirmed against a live instance that gcloud's |
lloyd-brown
enabled auto-merge (squash)
September 17, 2026 20:46
ishankaul1
approved these changes
Sep 17, 2026
Merged
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.
Problem
test_managed_jobs_recovery_multi_node_gcpfails on every run since #10396, andtest_managed_jobs_recovery_gcp/test_managed_jobs_cancellation_gcpfail whenever the jobs controller has reached job id 10. In smoke-tests 13078 the multi-node test failed 3/3 attempts after the job had reached RUNNING, at its own terminate step:Root cause
The tests filter on
labels.ray-cluster-name:<job name truncated to JOBS_CLUSTER_NAME_PREFIX_LENGTH>. The controller launches the cluster as<name>-<job_id>, and the GCP provisioner appliesmake_cluster_name_on_cloudwith GCP's 35-char limit, which keeps only the first35 - 2 - 1 - 9 = 23chars of the display name and appends-<2-char hash>-<8-char user hash>. #10396 (2026-08-08) widenedtest_idfrom 2 to 4 chars, soget_cluster_name()now yields 24- to 25-char names and the display name no longer fits:t-jobs-recovery-m-42-abcd(25)t-jobs-recovery-m-42-ab-13-<userhash>t-jobs-recovery-gcp-abcd(24)t-jobs-recovery-gcp-abcd-1-<userhash>t-j-cancellati-d8-abcd-3(24)t-j-cancellati-d8-abcd-3-1-<userhash>gcloud's
:operator is a word-prefix match, so...-42-3617can never match...-42-36-8v-.... The GCP tests only run in release builds, and the 0.13.2rc1 run (full-smoke-tests-run 126) never reached this step because of the us-central1 N4 stockout, which is why it surfaced only now.Fix
Add
smoke_tests_utils.get_managed_job_cluster_name_prefix_on_gcp(), which mirrors the production naming (JOBS_CLUSTER_NAME_PREFIX_LENGTH,GCP.max_cluster_name_length(),CLUSTER_NAME_HASH_LENGTH,USER_HASH_LENGTH) and returns the leading 23 chars that are guaranteed to survive, and filter on that in the three GCP tests. The prefix still includes the first two chars oftest_id, the same entropy the filter had before #10396. The AWS variants use aValues=<name>*wildcard and AWS has no 35-char limit, so they are unchanged.Side note, not changed here:
JOBS_CLUSTER_NAME_PREFIX_LENGTH = 25is documented as preventing a second truncation that hides the job id, but on GCP (35-char limit with the 9-char user hash) that already happens for any name of 25 chars, so the job id is routinely absent from GCP cluster names. Cosmetic only.Validation
/smoke-test --gcp -k "test_managed_jobs_recovery_gcp or test_managed_jobs_cancellation_gcp"on this PR (their zones, us-east4-b and us-west3-b, are outside the current us-central1 stockout).🤖 Generated with Claude Code