Skip to content

Commit bef883f

Browse files
committed
ci(ios): measure the cold daemon start at the public SDK ensure seam
The prepare step's daemon_startup diagnostic is not a cold-startup measurement: the CLI's ensured transport finishes ensureDaemon before sendToDaemon's timer wraps the attach connect, so the timer only sees an attach. Time the public ensureDaemon() directly after clean:daemon and record phase, durationMs, started, and pid, so the record counts as cold only when started is true. The prepare command keeps its original semantics and attaches to the same daemon. Corrects the measurement assumption behind 62a09bd on #3791; the cold-startup CI evidence for #3782 is still missing until a run reports this record with started:true.
1 parent 82c813e commit bef883f

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

‎.github/workflows/ios.yml‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,24 @@ jobs:
169169
- name: Preflight iOS runner through public CLI
170170
run: |
171171
pnpm clean:daemon
172-
# --debug keeps the daemon_startup diagnostic, which #3791 needs as the measured
173-
# successful cold-startup evidence for the startup budget (#3782). JSON stays on stdout.
174-
node bin/agent-device.mjs prepare ios-runner --platform ios --udid "${{ steps.ios-simulator.outputs.simulator-udid }}" --timeout "$AGENT_DEVICE_IOS_PREPARE_TIMEOUT_MS" --debug --json
172+
# Time the cold managed startup at the public SDK seam. The clean state dir above makes
173+
# this ensure the cold start, and `started` says whether it truly started one. The CLI
174+
# `daemon_startup` timer cannot be this evidence: it wraps only attach, which runs after
175+
# the ensured transport has already finished starting the daemon.
176+
node --input-type=module -e '
177+
import { performance } from "node:perf_hooks";
178+
const { ensureDaemon } = await import("./dist/src/index.js");
179+
const stateDir = process.env.AGENT_DEVICE_STATE_DIR;
180+
const startedAt = performance.now();
181+
const connection = await ensureDaemon({ stateDir });
182+
console.log(JSON.stringify({
183+
phase: "daemon_cold_startup",
184+
durationMs: Math.round(performance.now() - startedAt),
185+
started: connection.started,
186+
pid: connection.daemon.pid,
187+
}));
188+
'
189+
node bin/agent-device.mjs prepare ios-runner --platform ios --udid "${{ steps.ios-simulator.outputs.simulator-udid }}" --timeout "$AGENT_DEVICE_IOS_PREPARE_TIMEOUT_MS" --json
175190
176191
# The replay reuses the prepared runner in the same daemon. --debug keeps every step's request
177192
# log, not only the failing one, so a stale tap can be traced to its pre-tap capture (#3367).

0 commit comments

Comments
 (0)