Skip to content

feat: make iOS runs on small CI runners reliable and explain host starvation - #295

Merged
V3RON merged 9 commits into
mainfrom
ci/host-health-telemetry
Oct 26, 2026
Merged

V3RON merged 9 commits into
mainfrom
ci/host-health-telemetry

Conversation

@V3RON

@V3RON V3RON commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What is this?

iOS e2e jobs on the standard GitHub macOS runner (3 cores, 7 GB) failed at random. The simulator took 8–10 minutes to become ready, or Harness gave up at the 600s startup timeout, and nothing said why. This change makes those runs reliable for every project that runs Harness on small CI runners, and makes the cause visible when a run still struggles.

How does it work?

  • Telemetry. At session start, Harness records the busiest processes by CPU and memory. On CI, it warns, with a GitHub annotation, when the runner is already saturated before Harness starts, meaning less than 5% of the CPU is idle. When the platform does not become ready in time, PlatformReadyTimeoutError reports the peak load, average idle CPU, minimum free memory and swapped-out memory. If the CPU was almost never idle or memory was swapped out, it says the host was starved instead of suggesting a larger timeout.
  • Startup. On hosts with 3 cores or less than 8 GB, the Metro prewarm waits until the simulator has booted, instead of competing with the boot.
  • Simulator slimming. On CI hosts with 3 cores or less than 8 GB, Harness boots and waits for the simulator as before. It then stops 57 background services the tests never use (photo analysis, widgets, Siri, iCloud sync and similar) and silences five noisy log sources, before installing the app. This adds up to about a minute, has a 2-minute cap, and counts toward the platform-ready timeout. The new slimOnCI option of appleSimulator() forces it on or off; Harness never does this outside CI.
  • This repo's workflow. It turns off Spotlight indexing, drops the unneeded Watchman install, and boots the simulator early so the boot overlaps dependency installation. Harness reuses that simulator.

Why is this useful?

Measured on this repo's iOS e2e job:

Before After
Time until the simulator is ready 491–571s, or a 600s timeout 129–140s
Peak load about 720 71–84
Longest event-loop stall 13–30s 6–7s

Projects on standard GitHub macOS runners stop hitting platform-ready timeouts without having to change anything, whether or not they use the GitHub Action. When a run is still slow, the warning and the error message name the host as the cause, instead of leaving it a mystery.

V3RON added 7 commits October 26, 2026 08:59
…nners

- snapshot the busiest processes by CPU and RSS at session start
- warn (with a GitHub annotation) when the CI runner is saturated before startup
- attach peak load, min free memory and swapouts to PlatformReadyTimeoutError
- defer the Metro prewarm until the simulator is booted on small hosts
- e2e: disable Spotlight, drop watchman, pre-boot the simulator after Xcode setup
… hosted runners

Moves the simulator slimming from this repo's workflow into the GitHub
Action, through a new `harness ci prepare-ios-simulator` command, so
projects using the action get it too. It restores the full list of 57
services: the 11 cheapest-to-stop services left the runner as starved as
before.
@vercel

vercel Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-native-harness Ready Ready Preview Oct 26, 2026 3:49pm UTC

Request Review

…ation

- Warn about a saturated runner when idle CPU is below 5%, not on a
  lagging load average; blame a starved host on a timeout only for low mean
  idle CPU or swapping, not for the load a simulator boot causes.
- Give the prepare step an overall deadline, wait for a booting simulator
  before slimming it, and escape its warnings.
- Warn on an unknown slimIosSimulator value and skip Spotlight when it is
  false.
…the GitHub Action

Harness keeps booting the simulator itself, as before. After boot (and the
settle step), on CI hosts with 3 cores or less than 8 GB, it stops the
simulator's unused background services before installing the app. The
slimOnCI option of appleSimulator() overrides the host check. The action
step, its input and the `harness ci prepare-ios-simulator` command are
removed.
@V3RON
V3RON merged commit 4a8132c into main Oct 26, 2026
14 of 15 checks passed
@V3RON
V3RON deleted the ci/host-health-telemetry branch October 26, 2026 17:55

This branch was successfully deployed

1 active deployment
Preview — 4f43d2db Deployed Oct 26, 2026 by vercel[bot]
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