From 960e83742b408ed0b55efd718b06c2a0a4e5c357 Mon Sep 17 00:00:00 2001 From: "denis.bilenko" Date: Wed, 18 Nov 2026 08:15:49 +0000 Subject: [PATCH 1/2] acc: wait for RUNNING before planning in clusters/resize-terminated-fallback The planner chooses resize only when the cluster is RUNNING at plan time. On cloud the cluster is sometimes not RUNNING right after deploy, so the plan says update and the golden (Resized + /clusters/resize) mismatches. Wait for RUNNING before planning and record the planned action. cloud: TestAccept/bundle/resources/clusters/resize-terminated-fallback Co-authored-by: Isaac --- .../clusters/resize-terminated-fallback/output.txt | 3 +++ .../resources/clusters/resize-terminated-fallback/script | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/acceptance/bundle/resources/clusters/resize-terminated-fallback/output.txt b/acceptance/bundle/resources/clusters/resize-terminated-fallback/output.txt index 1b7f5da4ee8..55cd335b3ba 100644 --- a/acceptance/bundle/resources/clusters/resize-terminated-fallback/output.txt +++ b/acceptance/bundle/resources/clusters/resize-terminated-fallback/output.txt @@ -9,6 +9,9 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged >>> [CLI] bundle plan -o json +>>> jq -r .plan["resources.clusters.test_cluster"].action plan.json +resize + === Terminate the cluster before applying the saved plan >>> [CLI] clusters get [CLUSTER_ID] diff --git a/acceptance/bundle/resources/clusters/resize-terminated-fallback/script b/acceptance/bundle/resources/clusters/resize-terminated-fallback/script index e8780a28bb7..f858edd87b7 100644 --- a/acceptance/bundle/resources/clusters/resize-terminated-fallback/script +++ b/acceptance/bundle/resources/clusters/resize-terminated-fallback/script @@ -11,9 +11,15 @@ trace $CLI bundle deploy CLUSTER_ID=$($CLI bundle summary -o json | jq -r '.resources.clusters.test_cluster.id') add_repl "$CLUSTER_ID" CLUSTER_ID +# The planner picks resize only for a RUNNING cluster. Deploy returns once the cluster +# first reaches RUNNING, but on cloud it is sometimes not RUNNING by the time we plan, +# and the plan then says update instead of resize. Wait so the resize path is tested. +RETRY_MAX_ATTEMPTS=120 RETRY_INTERVAL_MS=5000 retry.py --until '"state": "RUNNING"' $CLI clusters get "$CLUSTER_ID" > /dev/null + title "Create a plan while cluster is running: should show resize" update_file.py databricks.yml "num_workers: 2" "num_workers: 3" trace $CLI bundle plan -o json > plan.json +trace jq -r '.plan["resources.clusters.test_cluster"].action' plan.json title "Terminate the cluster before applying the saved plan" $CLI clusters delete "$CLUSTER_ID" > /dev/null From 88b192dabb2e91ede9a85e199c1cbf59204b651c Mon Sep 17 00:00:00 2001 From: "denis.bilenko" Date: Wed, 18 Nov 2026 10:13:39 +0000 Subject: [PATCH 2/2] acc: re-plan until resize in clusters/resize-terminated-fallback Waiting for the first RUNNING still left a window where the cluster could leave RUNNING before the plan read it. Retry the plan itself until it says resize, using the retry helper (MSYS_NO_PATHCONV-safe on Windows). cloud: TestAccept/bundle/resources/clusters/resize-terminated-fallback Co-authored-by: Isaac --- .../clusters/resize-terminated-fallback/output.txt | 2 -- .../clusters/resize-terminated-fallback/script | 10 ++++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/acceptance/bundle/resources/clusters/resize-terminated-fallback/output.txt b/acceptance/bundle/resources/clusters/resize-terminated-fallback/output.txt index 55cd335b3ba..bc31d06d413 100644 --- a/acceptance/bundle/resources/clusters/resize-terminated-fallback/output.txt +++ b/acceptance/bundle/resources/clusters/resize-terminated-fallback/output.txt @@ -7,8 +7,6 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged === Create a plan while cluster is running: should show resize ->>> [CLI] bundle plan -o json - >>> jq -r .plan["resources.clusters.test_cluster"].action plan.json resize diff --git a/acceptance/bundle/resources/clusters/resize-terminated-fallback/script b/acceptance/bundle/resources/clusters/resize-terminated-fallback/script index f858edd87b7..46bd8f56f1a 100644 --- a/acceptance/bundle/resources/clusters/resize-terminated-fallback/script +++ b/acceptance/bundle/resources/clusters/resize-terminated-fallback/script @@ -11,14 +11,12 @@ trace $CLI bundle deploy CLUSTER_ID=$($CLI bundle summary -o json | jq -r '.resources.clusters.test_cluster.id') add_repl "$CLUSTER_ID" CLUSTER_ID -# The planner picks resize only for a RUNNING cluster. Deploy returns once the cluster -# first reaches RUNNING, but on cloud it is sometimes not RUNNING by the time we plan, -# and the plan then says update instead of resize. Wait so the resize path is tested. -RETRY_MAX_ATTEMPTS=120 RETRY_INTERVAL_MS=5000 retry.py --until '"state": "RUNNING"' $CLI clusters get "$CLUSTER_ID" > /dev/null - title "Create a plan while cluster is running: should show resize" update_file.py databricks.yml "num_workers: 2" "num_workers: 3" -trace $CLI bundle plan -o json > plan.json +# The planner picks resize only for a RUNNING cluster. Deploy returns at the first RUNNING, +# but on cloud the cluster can be out of RUNNING when the plan reads it, which plans an +# update instead. Re-plan until it says resize; once saved, the plan no longer depends on state. +RETRY_MAX_ATTEMPTS=60 RETRY_INTERVAL_MS=10000 retry --until '"action": "resize"' $CLI bundle plan -o json > plan.json trace jq -r '.plan["resources.clusters.test_cluster"].action' plan.json title "Terminate the cluster before applying the saved plan"