Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/platform-android/src/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ async function captureAndroidUiHierarchyFromHelper(params: {
captureOptions.idleWait = params.idleWait;
let sessionCapture: AndroidSnapshotHelperOutput | undefined;
try {
sessionCapture = await withDiagnosticTimer(
await withDiagnosticTimer(
ANDROID_SNAPSHOT_HELPER_SESSION_CAPTURE_PHASE,
async () => (sessionCapture = await captureAndroidSnapshotWithHelperSession(captureOptions)),
() => ({
Expand Down
2 changes: 1 addition & 1 deletion scripts/perf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ At the end, or on SIGINT or SIGTERM, the suite saves the logs to `raw/state/`, s
Each platform times the normal snapshot path and one forced path.

- iOS: the simulator accessibility bridge answers normal captures. `home-reads/snapshot-forced-tree` pins the XCTest tree backend through the SDK, because the CLI has no flag for it. Only a regular capture honors the pin; a raw capture runs its own backend ladder. The response must name the `tree` backend with the `requested-backend` reason code. The XCTest tree rejects the heavy feed, so the step runs on the home screen.
- Android: the snapshot helper APK is the only snapshot engine (ADR 0002). Its persistent session answers normal captures. `snapshot-raw-one-shot` restarts the daemon with `AGENT_DEVICE_ANDROID_SNAPSHOT_HELPER_SESSION=0`, so a one-shot `am instrument` capture answers. The harness restarts the daemon without the variable after the step. Both raw captures must reach depth 56. The forced capture must report the `instrumentation` transport.
- Android: the snapshot helper APK is the only snapshot engine (ADR 0002). Its persistent session answers normal captures. `snapshot-raw-one-shot` restarts the daemon with `AGENT_DEVICE_ANDROID_SNAPSHOT_HELPER_SESSION=0`, so a one-shot `am instrument` capture answers. The harness restarts the daemon without the variable after the step. Both raw captures must reach depth 56. `snapshot-raw` must report the `persistent-session` transport, and the forced capture must report the `instrumentation` transport.

## Platform parity

Expand Down
17 changes: 17 additions & 0 deletions scripts/perf/suite.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,20 @@ test('an Android capture breaks its expectation when another helper transport se
);
assert.match(expectationViolation(oneShot, {})!, /unknown transport/);
});

test('the Android heavy-feed raw capture expects the persistent session to answer', () => {
const heavyFeed = suiteFor('android').find((s) => s.id === 'heavy-feed')!;
const raw = heavyFeed.steps.find((s) => s.id === 'snapshot-raw')!;
assert.match(
expectationViolation(raw.expect, { maxDepth: 60, transport: 'instrumentation' })!,
/instrumentation transport served the capture, not persistent-session/,
);
assert.equal(
expectationViolation(raw.expect, { maxDepth: 60, transport: 'persistent-session' }),
undefined,
);
const iosRaw = suiteFor('ios')
.find((s) => s.id === 'heavy-feed')!
.steps.find((s) => s.id === 'snapshot-raw')!;
assert.equal(iosRaw.expect?.transport, undefined);
});
2 changes: 1 addition & 1 deletion scripts/perf/suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export const SUITE: readonly SuiteScenario<SuiteStep>[] = [
// The fixture renders more than 65 native levels on iOS and 60 on Android.
step('snapshot-raw', C.snapshot, ['snapshot', '--raw'], {
expect: { maxDepthAtLeast: 64 },
on: { android: { expect: { maxDepthAtLeast: 56 } } },
on: { android: { expect: { maxDepthAtLeast: 56, transport: 'persistent-session' } } },
}),
step('press-like-selector', C.press, ['press', 'id="heavy-post-0-like"']),
step('press-like-settle', C.press, ['press', 'id="heavy-post-1-like"', '--settle']),
Expand Down
Loading