fix(clean): bump simctl probe timeout and retry on cold boot#896
Merged
Conversation
CoreSimulatorService can take >2s to warm up on cold boot, causing a false "simctl not available" report. Bump initial timeout from 2s to 5s and add a single retry at 8s with a debug-log marker. Fixes tw93#890
- Sleep 1s before retry to give CoreSimulatorService more wall time - Unify log message to match comment (CoreSimulatorService) tw93#890
The existing simctl test (`clean_dev_mobile continues cleanup when simctl is unavailable`) mocks `xcrun` as a shell function, which puts the probe into the `declare -F xcrun` branch — NOT the timeout-retry branch where the tw93#890 fix lives. The fix was therefore untested. This test exercises the actual fix path: - Installs a real `xcrun` shim on PATH so `command -v xcrun` succeeds AND `declare -F xcrun` returns false, forcing the else branch. - Stubs `run_with_timeout` to return 124 (timeout) on the first probe and 0 on the retry, mirroring CoreSimulatorService warmup on cold boot. - Asserts the retry-success debug line appears in output and the "simctl not available" fallback message does NOT. Verified red-green: with the timeout/retry change reverted, the test fails on the `succeeded on retry` assertion; with the fix in place it passes.
Add a debug_log entry on the failure branch of the retry so a future operator inspecting the debug session can tell that two probe attempts were made (5s + 8s) before falling through to the "simctl not available" notice. Without this, the user-visible message gives no diagnostic hint that we already retried.
xronocode
added a commit
to xronocode/pages
that referenced
this pull request
May 15, 2026
- tw93/Mole#895 — fix(clean): apply should_protect_path in dry-run for orphaned system services - tw93/Mole#896 — fix(clean): bump simctl probe timeout and retry on cold boot Both merged by @tw93 2026-05-14; Mole card now has 5 merged PRs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
On cold boot,
CoreSimulatorServicecan take >2s to initialize. The probe:fails, and
mo cleanreportssimctl not availableeven though simctl works fine once the service is warm. The first failed probe actually warms the service, so the next run succeeds.Fix
Testing
bats tests/dev_extended.bats --filter "simctl"→ 1/1 okFixes #890