Skip to content

fix: retire test products across workspace lifecycles - #549

Open
KanbanTrainer wants to merge 2 commits into
getsentry:mainfrom
KanbanTrainer:codex/bounded-test-products
Open

KanbanTrainer wants to merge 2 commits into
getsentry:mainfrom
KanbanTrainer:codex/bounded-test-products

Conversation

@KanbanTrainer

Copy link
Copy Markdown

Source-based test calls currently leave an internal .xctestproducts bundle behind after their only consumer exits, and retention only runs when the same workspace key is used again. Abandoned worktree keys therefore accumulate multi-gigabyte products indefinitely.

This rebases and preserves Ian Rahman’s retention work from #532 on the current MobileBuildMCP codebase, then closes the abandoned-workspace gap:

  • source-based simulator, device, and macOS test calls retire their internal product after the test process settles;
  • explicit build-for-testing products remain reusable, with a time-bounded retention lease protecting planned consumers from count pruning;
  • startup performs a nonblocking cross-workspace test-products sweep, skipping active workspace locks and preserving active producers/readers;
  • retention settings now honor project config files as well as runtime and environment overrides;
  • cleanup failures are logged without replacing a completed test result.

The sweep is limited to MobileBuildMCP-managed test products. It does not delete logs, result bundles, DerivedData, unrecognized paths, or caller-owned products.

Validation: formatting, typecheck, lint (existing warnings only), build, and 59 focused lifecycle/config/test-executor tests pass. The full 2,616-test unit run passed 2,614 tests; the two unrelated environment-sensitive failures reproduce independently (init sees an existing user skill install, and the command-runner signal assertion observed SIGTERM instead of SIGKILL).

Warden runtime-boundary review could not run because the warden executable is not installed in this environment.

Closes #526
Refs #524
Continues #532

Implemented with AI assistance.

This branch has not been deployed

No deployments
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.

[Bug]: Orphaned workspaces are never swept — test-products for deleted project paths persist forever (126 GB past max age)

3 participants