Skip to content

feat: watch slims parallel-testing clones as they boot - #43

Open
enumcase wants to merge 1 commit into
MobAI-App:mainfrom
enumcase:feat/watch-parallel-testing-clones
Open

feat: watch slims parallel-testing clones as they boot#43
enumcase wants to merge 1 commit into
MobAI-App:mainfrom
enumcase:feat/watch-parallel-testing-clones

Conversation

@enumcase

@enumcase enumcase commented Sep 7, 2026

Copy link
Copy Markdown

Summary

Adds simslim watch: it polls the device sets and slims each simulator no-reboot the moment it boots, then leaves it alone. This is the hook for xcodebuild parallel-testing clones.

xcodebuild parallel testing creates a fresh clone per worker in its own device set, runs the tests, and deletes the clones when the run ends. The clones are created stock, and disable overrides do not survive simctl clone (this is why repair-clone exists), so there is no device to slim ahead of time. watch catches each clone once it boots and applies the no-reboot slim from #42. A clone slimmed a few seconds into a multi-minute run keeps its freed memory for the rest of the run.

This is the automated answer to the ephemeral-clone case in #41, where slimming ahead of time was not possible.

Usage

simslim watch --except web,store &
xcodebuild test -scheme App -parallel-testing-enabled YES -parallel-testing-worker-count 4 ...

Takes the same --profile/--except/--keep selection as on. Scans the default and testing sets plus any passed with --set, on a --interval (default 3s). Runs until Ctrl-C.

Behavior

  • Each booted device is slimmed once. A steady poll does not re-slim a device it already handled, and a shutdown device is never touched.
  • Slimming runs per device in its own goroutine, so one slow reconfigure does not delay catching the next clone.
  • A clone that is torn down mid-slim (the test run ended) fails that one slim, is logged, and the loop continues.

Validation

Local, iOS 26.1, on a real xcodebuild -parallel-testing-worker-count run:

  • watch detected each parallel-testing clone as it booted and targeted it for the no-reboot slim.
  • Isolated live clone: a booted stock clone reached 170/170 disabled in 35s with no reboot, the same end state as simslim on.
  • Base simulator, full profile: 181 -> 88 processes, 2.94 GB -> 1.37 GB.
  • A full sequential run of a ~35,000-test suite on a fully slimmed simulator passed, so the profile does not destabilize the tests.

Tests

  • New fake-xcrun test: a booted device is slimmed exactly once across repeated scans, a shutdown device is never slimmed.
  • make check green (go test ./..., go vet, swift-format lint, build-app.sh).

Builds on #42

watch reuses EnableSlimNoReboot from #42 (now merged). Rebased onto main, so this PR is a single commit with no dependency.

xcodebuild parallel testing creates a stock clone per worker in its own
device set and deletes them per run; disable overrides do not survive
simctl clone, so there is no device to pre-slim. watch polls the device
sets and applies a no-reboot slim to each simulator once it boots, then
leaves it alone, reusing EnableSlimNoReboot from MobAI-App#42.

Answers the ephemeral-clone case raised in MobAI-App#41.
@enumcase
enumcase force-pushed the feat/watch-parallel-testing-clones branch from 8d3b68b to 816d783 Compare September 8, 2026 10:10
@enumcase
enumcase marked this pull request as ready for review September 8, 2026 10:10
@enumcase

enumcase commented Sep 8, 2026

Copy link
Copy Markdown
Author

@Interlap01 Hello! Sorry for sudden PR, but I guess it aligns well with your recent changes at #42

I've been trying to experiment with parallel tests on iOS and trying parallel simulators too. Thank you for enabling cool things with #42

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.

1 participant