1. Introduction
Wardrobe Valet is an iOS app that turns photos of clothes into a wardrobe and outfit suggestions. Its user-interface (UI) tests drive the app through photo permissions, scanning, consent, item review and outfit suggestions. They use a local fake backend: a test server that returns controlled responses so we can exercise success and failure without depending on live services. At the start, a full run took about 35 minutes. That made it expensive to check a change across the whole app.
We call the checks a change must pass before merging a gate. By the end of the ten-day effort, one complete gate ran in 3 minutes 47 seconds, with 80 tests included in the runner’s test list rather than the original 51. Getting there required changes to test setup, polling and the way development sessions shared a machine. We split tests into parallel groups called shards, each with its own iOS simulator: a virtual device running on the Mac.
The useful part of this story is how we found those costs. The tests could pass while spending minutes repeating setup or waiting on the wrong UI state. The optimization work also produced real failures: invalid test data, missing photo libraries and broken cancellation. Those failures needed fixes of their own.
The inspiration for our shared QA workflow came from the relationship between developers and a QA team. A developer hands over a specific build for testing, then continues working. QA schedules the work against its available people and equipment, tests that build, and returns a result tied to it. The handoff separates development from verification without losing track of what was tested.
We wanted that same relationship between our development sessions and the automated test suite. Sessions could work on different changes at once; full-suite testing would use a shared, scheduled resource. Here, the “QA team” is an automated service running predefined checks. It does not provide a human tester’s exploratory judgment.
This case study documents three contributions: a test setup that preserves the flows under test while removing repeated preparation; an isolated parallel runner with timing-aware workload allocation; and a shared verification service that ties each result to a submitted code snapshot. We examine the runtime observations and the failure modes exposed while building that service.
3. System design
We developed the system incrementally over ten days. Each change addressed a cost or failure observed in the preceding configuration. The following subsections describe the mechanisms; Section 5 collects the aggregate runtime observations.
3.1. Prepared test state
The original run’s logs put about 30 of its 35 minutes inside test execution. Booting simulators, installing the app and checking builds accounted for roughly five. Reducing calls to xcodebuild, Apple’s command-line tool for building and testing apps, would help, but could not explain most of the runtime.
Many tests used the same setup helper, launchIntoBuiltWardrobe, to create a usable wardrobe. It repeated the whole setup flow: launch, grant photo access, scan, accept consent, refine the detected clothing items through the backend, then wait for them to appear. That repeated roughly 40–60 seconds of setup before 10–20 seconds of assertions.
We added a launch option available to debug/UI tests that directly creates an already-built wardrobe. This is seeding: loading prepared test data, or a fixture, instead of recreating it through the interface. We also reset saved app state inside the running app so one test would not inherit another’s data. Tests about asking for outfits could start at that state. Tests about scanning, consent or permissions continued to exercise those flows. Persistence tests dropped the reset and seed keys on relaunch so that they still tested persistence.
The first seed was too small. It contained one already-worn outfit with two items. At that point, the outfit-suggestion service had a rule against recommending the same combination the user had already worn. The fake backend enforced that rule too. With only one pair available, every possible suggestion repeated it. A plausible-looking wardrobe was permanently unstylable. We expanded the seed to two outfits and four items, matching the data produced by our existing scan test, so other combinations were possible.
Think of the seed as a prepared test bench: a test about outfit suggestions needs a usable wardrobe already in place, while a test about building that wardrobe must still start from scratch. Seeding saves time only when the fixture satisfies the same contracts as the state it replaces. Reading the fake backend’s refusal logic resolved a failure that looked, from the UI, like a retry problem.
3.2. Polling under a shared deadline
The first-scan test took 177 seconds. We could not seed past it because the scan was what it tested. It would also place a lower bound on any shard that contained it.
The expensive wait was in the test. A probe accepted either a build-status indicator or the detected clothing items, but it spent the full 120-second item wait even when the build-status condition had already been satisfied. The fix stopped waiting once either accepted outcome appeared. The recorded shard fell from 285 to 96 seconds during the optimization sequence; that is a shard observation, not an isolated per-helper speedup.
A photos-availability helper had a related problem: it could spend a 30-second wait on one outcome before inspecting another valid permission screen. We changed it to poll accepted outcomes under one deadline.
# Pseudocode: one deadline for all valid outcomes.
deadline = now() + timeout
while now() < deadline:
if build_status_visible() or detected_items_visible():
return ready
wait_for_next_poll()
fail_with_observed_ui_state()
Illustrative logic for Apple’s XCTest testing framework, not drop-in code. The actual UI probes must also avoid blocking for a full timeout individually.
We preserved failure deadlines where possible. Finishing early when success is visible improves runtime without giving a slow, valid flow less time to complete.
3.3. Isolated parallel execution
We built the app and tests once, then used shell scripts to start eight shards with test-without-building, which reuses that compiled build. Each shard owned a simulator and a fake backend. The fake remembered settings such as “return an error” and how many requests it had received. Sharing one fake would let a test in one shard alter the responses seen by another. XCTest can create parallel test workers itself, but in our setup those workers would have shared the fake; starting our own workers let us give each one a separate instance.
Splitting the suite exposed setup assumptions. Fixture photos had been seeded once at the start of the serial runner; newly independent simulators had empty libraries. Seeded launches also skipped the permission walk, so relaunch tests reached a permission state the old path had avoided.
Other failures were introduced by our changes. Accelerating test timers interfered with countdown-driven UI. That was a regression to repair, not evidence of a pre-existing ordering dependency. We corrected the affected flows before accepting the faster runner.
Fresh simulators brought their own contention. Eight workers creating and using new devices incurred substantial overhead in CoreSimulator, Apple’s simulator-management service. We moved to reusable simulator pools for each checkout, retained installed apps, and made in-process reset responsible for test state. The first run still paid the cost of creating the pool; the 171-second observation was a warm run.
A startup validator checked that serial and sharded rosters contained the same tests, with no duplicates. The original review also recorded flow assertion counts increasing from 233 to 236, while assertions for outfit-question tests remained at 87. Those counts help detect dropped checks; they do not prove equivalent coverage. The retained pipeline tests and the diff review matter too.
3.4. Timing-aware workload allocation
The sum of these elapsed times is 1,436 seconds, or about 180 seconds per shard if divided evenly. That average is a rough scheduling reference, not an attainable lower bound: it includes overhead, and some test sequences cannot be split or moved freely.
The review reported a ratio of slowest to fastest shard near 3.5× before and 1.15× afterward. The environments differed: the “after” run used a QA slot with cold simulators and roughly 110 seconds of extra first-batch cost per shard. Adding common overhead compresses a ratio. The result supports a more even observed run, but the ratio alone cannot isolate the benefit of rebalancing. A matched warm comparison in the original environment remained outstanding.
3.5. A shared verification queue
The machine made the capacity constraint concrete. Multiple sessions could each start eight simulators from separate Git worktrees, which let different branches have their own working checkouts. Recorded gate attempts under overlapping UI suites and a build failed with element-wait timeouts; a quiet-machine attempt passed. Separate checkouts isolated the code, but they still competed for the same machine. It was like giving every developer a test booking without checking whether the lab had enough equipment.
We introduced one queue for full gate runs, processed first in, first out (FIFO). Each submission became a saved testing request identifying a Git commit hash, or SHA: the exact code snapshot to test. Submissions with uncommitted changes were rejected so the request could not omit work that existed only in the developer’s checkout.
- Hand overA specific code snapshot
- ScheduleA saved request in the queue
- TestOne dedicated checkout
- ReportLogs + exit status for that job
A worker process called the drainer took requests from the queue and ran them in the dedicated slot. A lock allowed only one drainer at a time. Full gates therefore ran one after another, while the eight shards inside each gate still ran in parallel. This gave the shared lab a capacity limit instead of letting every session reserve the whole machine at once.
The build handoff also shaped how we selected test logic. Each job ran the verification scripts from its submitted commit, so a branch that changed the runner would test its own changes. The queue managed scheduling and results; the repository continued to define what needed testing. Keeping the slot at a stable filesystem path let jobs reuse the same simulator pool, much as a QA team keeps its test devices ready between builds.
A testing request also needs an honest status when work stops. If a drainer died, a later invocation claimed recovery, marked the interrupted request abandoned and cleaned up its processes. It did not silently retry the job into a passing verdict. Switching between divergent commit histories also cleared the slot’s cached build output to avoid testing an old compiled version of the code.
Queueing trades simultaneous execution for waiting; we did not measure how long developers waited or how much time they saved. Direct runs that bypass the queue can still compete for the same machine resources.
3.6. Cancellation and environment lifecycle
The queue exposed two lifecycle problems. First, aborting a run signalled worker shells while their child xcodebuild processes continued running tests. The shells were waiting on those processes, so signalling only the shells did not stop the actual work. One wedged run kept going for more than 40 minutes after the abort request.
The fix recorded the xcodebuild process ID, checked that it belonged to the current run, and signalled it before its worker shell. A live verification then stopped the process tree in about one second, preserved shard summaries and returned the interrupted exit status. The implementation used a fresh Bash process followed by exec to retain the PID, because the machine’s Bash 3.2 did not support BASHPID.
Second, the drainer shut down pool simulators whenever it finished processing the queue. We had built a shared test lab, then powered down its devices between batches of work. Reusing the slot’s path was not enough: the next job still started with cold devices.
We kept simulators booted after a clean drain and retired them after an hour of inactivity. A detached timer checked a timestamp, acquired the drainer lock and checked the timestamp again before shutdown. A newer drain superseded the old timer. Later queue operations also performed an opportunistic sweep; abnormal exits still shut devices down immediately.
4. Evaluation setup
These are historical observations from one development machine, an M4 Max with 16 CPU cores and 48 GB of memory. The runner is the script that prepares the environment, starts tests and collects their results. Workloads and run boundaries changed during this effort, so these observations show the sequence of improvements rather than a controlled speedup ratio.
We report elapsed runtime for successful runs, elapsed time per shard, registered test counts and selected failure diagnoses from internal engineering reviews. These are observations collected during development, not a prospective experiment with a fixed workload. The early UI-runner measurements and later combined gates have different boundaries. Queue waiting time is excluded from gate duration.
We retain failed-run diagnoses because they explain design changes, but do not treat interrupted or failed runs as successful performance measurements. No ablation study isolates the effect of each optimization.
5. Results
5.1. Recorded runtime milestones
How the recorded runtime changed
● UI runner · 51 tests■ Combined gate · 80 tests
| Observation | Scope | Recorded time |
|---|---|---|
| Original serial run | 51 UI tests; 35 build/test-tool invocations | ≈35 min |
| First optimization, warm pool | 51 tests; 8 shards; two passing runs | 171s / 282s |
| Later queued gate, cold slot | Tier 0 + tier 2 gate; 80 tests; full rebuild | 6m17s |
| Later queued gate, warm slot | Tier 0 + tier 2 gate; 80 tests; full rebuild | 3m47s |
The early runs measure only the UI runner; the later runs include both verification tiers. Gate duration excludes waiting for a slot. Both later observations include a full rebuild of the app and tests.
The first optimization’s review records two passing runs at 171 and 282 seconds. The faster observation alone would hide that variation. Likewise, the 51-to-80 growth is about 57%, but test count alone says little about how much work a suite performs.
5.2. Workload imbalance and rebalancing
Eight days later the suite contained 80 tests and had drifted back toward six or seven minutes. New tests had been appended to groups that looked related. Nobody had rebalanced those groups against their measured cost.
One warm run made the problem visible. Shard 4 contained 38 tests and finished in 164 seconds. Shard 2 contained nine and took 344 seconds. Many of shard 4’s cases were very short checks around App Attest, Apple’s mechanism for verifying that requests come from a genuine app instance. Elsewhere, one test checking the outfit collage across item counts and panel positions took 127 seconds on its own.
Eight shards, one long wait
Warm pool, before rebalancing · seconds per shard
Warm pool, before rebalancing · seconds per shard
Workload allocation used both measured timings and ordering constraints (Section 5.2). Photo-permission sequences stayed together on shard 1 because the privacy orchestration depended on their order. Tests for replacing an item in a suggested outfit kept a dedicated shard because they changed the fake backend’s responses. A retry test ran after other backend users because a failure could leave the fake returning HTTP 503 (service unavailable). We split a 332-second seeded batch and redistributed the outfit-question tests around those constraints.
5.3. Cold and warm environments
| Measure | Cold slot | Warm slot |
|---|---|---|
| Shard wall range | 306–370s | 184–220s |
| Mean shard wall | ≈339s | ≈204s |
| Combined gate | 6m17s | 3m47s |
Both gates passed 80 tests across eight shards and paid a full rebuild of the cached app and test binaries. That makes build-cache reuse an unlikely explanation for the difference. Each condition was measured once on a different revision. This supports retaining warm simulators, but does not establish typical runtime or a confidence interval.
6. Discussion and limitations
The observations support a faster verification path in this project. They do not establish a general speedup factor: the suite grew, code revisions changed, and simulator conditions differed. A single cold/warm pair cannot establish typical latency or variability across machines.
We produced a faster full-suite path with explicit test membership, per-shard state boundaries, versioned jobs and inspectable failures. Claude and Codex assisted with the implementation; the outcome we measured was the app’s verification workflow. This work does not compare model quality or establish how much time AI assistance saved.
The developer–QA analogy was useful because it made ownership and capacity explicit. A submission names the build, the queue allocates shared equipment, and the result belongs to that submission. The service still depends on the quality of predefined checks; it cannot replace exploratory testing or infer that passing tests cover every product behavior.
We did not measure developer productivity, queue-delay percentiles or the rate of failures under controlled machine load. Runs that bypass the queue can still contend with scheduled work. Test membership and assertion counts guard against accidentally dropping checks, but do not establish coverage equivalence.
The next engineering improvement would be to detect uneven shard runtimes automatically. A comment asking the next editor to check the timings still depends on someone remembering to do it.
7. Conclusion
Reducing verification latency required changes at several levels: valid prepared state, prompt detection of accepted UI outcomes, isolated parallel workers, measured workload allocation and explicit ownership of shared resources. The later warm gate completed 80 tests and fast checks in 3 minutes 47 seconds, excluding queue wait. Its practical contribution is a traceable verification workflow whose state and failures can be inspected.
For a similar suite, start by recording setup time, actual test time, polling time, per-shard wall time and queue delay separately. Preserve the failing runs for diagnosis, and compare performance on successful runs under matched conditions. Those records tell you which change to make next.
Wardrobe Valet · iOS
Put your wardrobe to work.
Turn photos of your clothes into a digital wardrobe and outfit suggestions. Join the waitlist to hear when you can try Wardrobe Valet.
Reproducibility and data availability
The results in this article come from our internal development runs and engineering reviews over the ten-day effort. We have included selected observations and their conditions to explain the engineering decisions. The underlying repository, review records and raw measurement data remain private.
No new iOS benchmark was run for this article. A reproducible benchmark would require repeated runs with fixed code revisions and simulator states, exact operating-system and developer-tool versions, machine-load records and queue-wait measurements. The retained evidence does not provide that complete dataset.
References
- OpenAI. Harness engineering. Engineering article.
- Anthropic. Quantifying infrastructure noise in agentic coding evals. Engineering article.