Skip to content

direct: add DATABRICKS_BUNDLE_RESOURCE_MAX_WAIT to cap resource waits - #6263

Open
denik wants to merge 11 commits into
mainfrom
denik/resource-max-wait
Open

direct: add DATABRICKS_BUNDLE_RESOURCE_MAX_WAIT to cap resource waits#6263
denik wants to merge 11 commits into
mainfrom
denik/resource-max-wait

Conversation

@denik

@denik denik commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Changes

DATABRICKS_BUNDLE_RESOURCE_MAX_WAIT (in seconds) caps how long deploy and destroy wait for a resource to reach its target state. On expiry the wait is abandoned with a warning rather than failing the deploy: state is saved before the wait, so the resource stays tracked and the next deploy reconciles it. 0 skips the wait without issuing a request.

A resource keeps its full wait when something that runs after it needs it provisioned. Its own .permissions / .grants children do not count: they reference nothing but the parent's id, which DoCreate returns before the wait starts. Deletes are capped regardless of dependents, except the delete inside recreate, which has to release the name for the create that follows. Direct engine only.

Applied to the vector search index tests that only need the index to exist, not to be queryable: basic, grants/select, and the vector_search_index invariant configs. All three now run on every PR rather than nightly-only, and the invariants are no longer excluded from cloud at all.

Why

Vector Search index provisioning takes 15-30 minutes, which made these by far the slowest tests on cloud.

test env before after
basic aws linux 22m32s 1m14s
azure linux 28m33s 1m13s
gcp linux 12m39s 1m25s
aws windows 30m28s 1m36s
azure windows 18m26s 1m30s
gcp windows 14m41s 1m23s
grants/select aws linux 21m24s 1m23s
azure linux 20m31s 1m51s
gcp linux 14m52s 1m43s
aws windows 22m23s 1m26s
azure windows 18m32s 3m05s
gcp windows 12m23s 1m39s
invariants aws linux excluded from cloud; 21m42s–25m45s measured uncapped 1m40s–3m42s
azure linux excluded from cloud 1m48s–4m58s
gcp linux excluded from cloud 1m46s–5m23s
aws windows excluded from cloud 1m48s–4m37s
azure windows excluded from cloud 1m59s–4m53s
gcp windows excluded from cloud 2m21s–4m38s

Before is nightly run 32294089064 (basic and grants/select are CloudSlow, so the nightly is the only place they ran). The invariant config was excluded from cloud altogether, so it has no nightly figure; the uncapped number quoted for it is a local run against the aws-cli env with the cap removed and TimeoutCloud raised to 90m. That last part matters: two of the six variants took over 25m uncapped, which is the default TimeoutCloud, so enabling them without the cap would time out rather than merely be slow. After is run 32253634089 on this PR. The invariants range spans six variants per env: no_drift, delete_idempotent and destroy_idempotent, each with and without READPLAN.

What stays slow

recreate/embedding_dimension (13-21m) keeps its full waits and stays CloudSlow. Capping it breaks the test: the capped create leaves the index provisioning, so the recreate then deletes a provisioning index and exceeds the 15m deleteIndexTimeout. Capping the recreate's delete wait too would just move the failure to pendingDeletionTimeout.

The cap is set per config rather than for the whole invariant directory on purpose. This index is three orders of magnitude slower than the next slowest invariant config (cluster, ~100s), and capping every config would leave nothing exercising a real WaitAfterCreate against a real backend.

Tests

Unit tests for parsing, the child-dependency rule and the wait semantics, including that a genuine failure still fails the deploy and that cancelling the deployment is not swallowed. Two acceptance tests: resource-max-wait covers parsing, and resource-max-wait-zero covers what the cap does to a wait — it deploys a cluster with the cap at 0 and asserts the poll GET is absent, since the test server only advances a cluster from PENDING to RUNNING on read, so the missing poll is what proves the resource was left unwaited.

Cloud-checked rather than assumed: a capped create does not produce spurious drift. grants/select re-plans to 0 to add, 0 to change, 0 to delete and no_drift passes verify_no_drift.py (which requires every action to be skip) on all six clouds. The grant also applies to an index that is not ready yet, and the two idempotency invariants survive deleting an index whose first delete was cut short.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 165db3c

Run: 32369997850

Env 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 2 3 288 1444 7:18
💚​ aws windows 2 3 290 1442 7:05
💚​ azure linux 2 3 287 1444 6:50
🔄​ azure windows 2 2 3 287 1442 7:28
💚​ gcp linux 2 3 288 1444 8:37
💚​ gcp windows 2 3 290 1442 7:42
7 interesting tests: 3 SKIP, 2 RECOVERED, 2 flaky
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/invariant/no_drift 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestFilerWorkspaceNotebook ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p
🔄​ TestFilerWorkspaceNotebook/rJupyterNb.ipynb ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p
Top 12 slowest tests (at least 2 minutes):
duration env testname
3:51 azure linux TestAccept
3:45 gcp linux TestAccept
3:44 aws linux TestAccept
3:37 azure windows TestAccept
3:13 aws windows TestAccept
3:07 gcp windows TestAccept
2:33 gcp windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=vector_search_index.yml.tmpl/READPLAN=1
2:19 gcp windows TestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=vector_search_index.yml.tmpl/READPLAN=1
2:14 gcp linux TestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=vector_search_index.yml.tmpl/READPLAN=
2:11 aws windows TestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=vector_search_index.yml.tmpl/READPLAN=1
2:06 aws windows TestAccept/bundle/invariant/destroy_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=vector_search_index.yml.tmpl/READPLAN=1
2:01 gcp linux TestAccept/bundle/invariant/delete_idempotent/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=vector_search_index.yml.tmpl/READPLAN=1

@denik
denik force-pushed the denik/resource-max-wait branch from a399df2 to 0036738 Compare August 18, 2026 09:22
denik added 9 commits August 18, 2026 11:59
A .permissions or .grants child references only its parent's id, which DoCreate
returns before the wait starts, so it does not need a provisioned parent. Exclude
child nodes when deciding whether a resource has a dependent, and cap the wait in
the vector search index grants test.

Co-authored-by: Isaac
A zero cap built an already-expired context and still spent one poll learning what
the caller said it did not care about. Returning early makes it observable: the new
acceptance test deploys a cluster, which the test server only advances from PENDING
to RUNNING on read, so the absent poll is what proves the resource was left unwaited.

Co-authored-by: Isaac
They were excluded from cloud for taking 10-20 minutes, all of it waiting for the
index to provision. None of the invariants need a queryable index, so cap the wait
per config instead of skipping the coverage.

Co-authored-by: Isaac
# Conflicts:
#	acceptance/bundle/invariant/test.toml
Jobs have no WaitAfterCreate, so a zero cap there asserted nothing -- the step passed
whether or not the zero path worked. resource-max-wait-zero covers it on a cluster,
which does wait.

Co-authored-by: Isaac
The assertion is whether the poll GET happened, so the cluster body was churn: any
change to the test server's cluster defaults would have broken it.

Co-authored-by: Isaac
Co-authored-by: Isaac
Comment thread bundle/direct/bundle_apply.go
@denik
denik requested a review from shreyas-goenka August 20, 2026 13:02
# provisioned index, so the wait is capped here too. Runtime becomes ~2x the cap.
Env.DATABRICKS_BUNDLE_RESOURCE_MAX_WAIT = "30"

# No longer slow once the wait is capped, so run it on every PR.

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.

does this generalize to more cloudslow tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants