Skip to content

acc: stop bundle-generate tests leaking cloud workspace dirs#5946

Open
janniklasrose wants to merge 2 commits into
mainfrom
janniklasrose/cleanup-workspace-test-dirs
Open

acc: stop bundle-generate tests leaking cloud workspace dirs#5946
janniklasrose wants to merge 2 commits into
mainfrom
janniklasrose/cleanup-workspace-test-dirs

Conversation

@janniklasrose

@janniklasrose janniklasrose commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Why

Several bundle/generate acceptance tests create directories on the real workspace (they have Cloud = true) and never reliably remove them, so leftovers accumulate on shared test workspaces (e.g. azure-prod-ucws-is), bloating workspace list /. This was observed contributing to a workspace-listing integration test hanging.

Two distinct leaks:

  1. genie_space, dashboard, alert each ran workspace mkdirs /Workspace/test-$UNIQUE_NAME at the workspace root and used it as the parent_path for the resource they create. Nothing deleted it: no script.cleanup, and the eng-dev-ecosystem env cleaner only sweeps /Users, never the root. The alert test also frequently times out (TimeoutCloud = "5m", Add 5-minute timeout to alert tests to prevent CI hangs #4221).
  2. auto-bind deployed its bundle to /Workspace/tmp/$UNIQUE_NAME. Its bundle destroy removes that on the happy path, but the inline trap only cleaned the /Users/.../python-* notebook dirs — so a failure before destroy leaked the root into the shared, unswept /Workspace/tmp namespace.

What

Every generate test that creates workspace state now cleans up after itself, in the swept user tree:

  • Relocated the three root dirs to /Workspace/Users/$CURRENT_USER_NAME/test-$UNIQUE_NAME, and added a script.cleanup to each that recursively deletes it (removing the genie space / dashboard / alert created inside).
  • Moved auto-bind's bundle root to ~/.bundle/auto-bind-test-$UNIQUE_NAME, matching the ~/.bundle convention every other bundle acceptance test uses.

Output goldens regenerated with -update; the full bundle/generate suite passes locally.

This pull request and its description were written by Isaac, an AI coding agent.

The genie_space, dashboard, and alert bundle-generate acceptance tests
created their parent directory at the workspace root
(/Workspace/test-$UNIQUE_NAME). On cloud runs this dir is created on the
real workspace, and nothing deletes it: these tests have no
script.cleanup, and even one would not help the alert test, which
frequently times out (see #4221) before cleanup could run. The
eng-dev-ecosystem env cleaner only sweeps /Users, not the workspace
root, so these dirs accumulated indefinitely and bloated `workspace list
/`.

Move the parent dir under /Workspace/Users/$CURRENT_USER_NAME/ so it
lands in the swept user tree. The root path was not required for any of
these features.

Co-authored-by: Isaac
Make each bundle-generate test that creates cloud workspace state remove
it, so nothing is left behind on the real workspace after a cloud run.

- genie_space, dashboard, alert: add a script.cleanup that recursively
  deletes the per-run /Workspace/Users/$CURRENT_USER_NAME/test-$UNIQUE_NAME
  directory (and the genie space / dashboard / alert created inside it).
- auto-bind: deploy the bundle to ~/.bundle/auto-bind-test-$UNIQUE_NAME
  instead of /tmp/$UNIQUE_NAME. The old root landed in the shared,
  unswept /Workspace/tmp namespace and leaked whenever the script failed
  before `bundle destroy`. This matches the ~/.bundle convention used by
  every other bundle acceptance test.

Co-authored-by: Isaac
@janniklasrose janniklasrose changed the title acc: create bundle-generate test dirs under /Workspace/Users to avoid workspace-root leaks acc: stop bundle-generate tests leaking cloud workspace dirs Jul 16, 2026
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 21de3b6

Run: 29508674588

Env 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 227 1119 4:44
💚​ aws windows 4 4 229 1117 9:04
💚​ aws-ucws linux 4 4 316 1035 6:58
💚​ aws-ucws windows 4 4 318 1033 10:16
💚​ azure linux 4 4 227 1118 4:46
💚​ azure windows 4 4 229 1116 8:42
🔄​ azure-ucws linux 3 3 4 316 1032 7:42
💚​ azure-ucws windows 4 4 320 1030 9:38
💚​ gcp linux 4 4 226 1120 5:02
💚​ gcp windows 4 4 228 1118 8:59
10 interesting tests: 4 SKIP, 3 flaky, 3 RECOVERED
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🔄​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 🔄​f 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/ssh/connect-serverless-cpu 🙈​s 🙈​s ✅​p ✅​p 🙈​s 🙈​s 🔄​f ✅​p 🙈​s 🙈​s
🔄​ TestAccept/ssh/connect-serverless-cpu/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p 🔄​f ✅​p
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 9 slowest tests (at least 2 minutes):
duration env testname
8:41 aws-ucws windows TestAccept
8:37 aws windows TestAccept
8:34 gcp windows TestAccept
8:22 azure-ucws windows TestAccept
8:15 azure windows TestAccept
2:58 gcp linux TestAccept
2:52 azure linux TestAccept
2:51 aws linux TestAccept
2:50 aws-ucws linux TestAccept

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