SIGN IN SIGN UP
tw93 / Mole UNCLAIMED

🐹 Deep clean and optimize your Mac.

0 0 85 Shell

fix(clean): bump simctl probe timeout and retry on cold boot (#896)

* fix(clean): bump simctl probe timeout and retry on cold boot (#890)

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 #890

* fix(clean): add sleep 1 before simctl retry and unify log message

- Sleep 1s before retry to give CoreSimulatorService more wall time
- Unify log message to match comment (CoreSimulatorService)

#890

* test(clean): cover timeout-retry branch of simctl probe (#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 #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.

* fix(clean): log when simctl probe fails after retry (#890)

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.
M
Mike Evdokimov committed
35d856f1e1ff54e8a7f5d2b67157634fd9280155
Parent: cfe1460
Committed by GitHub <noreply@github.com> on 5/15/2026, 8:20:56 AM