iOS: XCTest-channel penalty keeps the runner in private-AX fallback most of a long session (fixed 3 s / 120 s, no override)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- ios, typescript
- Domaine
- mobile, performance, testing
Piste de recherche
Read the snapshot penalty and capture plan code under dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/, starting with RunnerTests+SnapshotTiming.swift, RunnerTests+SnapshotCapturePlan.swift, and the snapshot CLI entry point. Check the related issue #1542 and presentedSurface work in #3565 before choosing a scope. Done means the requested penalty controls and CLI backend option behave as specified, with tests covering single query timeouts and recovery probes.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
On a heavy UIKit app (iPad simulator), one slow or timed-out XCTest-channel snapshot tier puts the runner into private-AX fallback for 120 s. A timed-out 1 s recursiveTree recovery probe re-arms it; that probe runs when the private-AX capture is rejected. And once the penalty expires, the next capture's 1 s query sweep often times out and penalizes the channel again. In one long-running session log, 71 % of snapshot commands ran with the XCTest channel deferred.
In our captures, private-AX returned presented screens together with the screen underneath them. A test then can't reliably tell which screen is top-most, and an element of the covered screen looks "visible". For read-only checks this is mostly harmless. For steps that must act on the right screen (bulk select / destructive bulk actions in a list), it's unsafe, so we refuse those steps whenever a fallback happened in the last 120 s.
Version / environment
- agent-device 0.21.25 (pinned by
@e2e-dev/mobile0.12.0, used through thee2e0.20.0 runner). The penalty logic is unchanged in 0.21.28 and 0.21.29-nightly.20261020. - Xcode 27.0 (27A266a), iOS 27.0 simulator runtime, iPad Air 11-inch (M4) simulators
- UIKit app with long table views
What the source shows (0.21.25, dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/)
- An XCTest-channel tier penalizes the channel when it times out, exhausts its deadline, or takes longer than
snapshotXCTestSlowCaptureThreshold(3 s):RunnerTests+SnapshotTiming.swift:119-155, constant atRunnerTests.swift:139. Budgets: tree slice 8 s (RunnerTests.swift:143), query sweep 1.0 s (RunnerTests+Snapshot.swift:134-143), viewport read ≤ 1.0 s (RunnerTests+SnapshotAcquisition.swift:50-56). A system-modal probe timeout also penalizes (RunnerTests+Snapshot.swift:360). penalizeSnapshotXCTestChannelsetspenaltyUntil = now + 120 s(RunnerTests+SnapshotCapturePlan.swift:133-143,RunnerTests.swift:122). While it's active, the plan puts private-AX first, plusrecursiveTreewith a 1 s slice (RunnerTests+SnapshotCapturePlan.swift:110, 256-277).- Each slow or timed-out XCTest attempt during the penalty re-arms it. In practice that's the 1 s tree probe, which runs when the private-AX tier fails or is rejected (
RunnerTests+SnapshotCapturePlan.swift:272, 391-431).penaltySuppressedapplies only to the one-shot warm-up after a target PID change (:304, 373-378;RunnerTests+Lifecycle.swift:254). - It's cleared only by
targetReset/ a new target PID (RunnerTests+Lifecycle.swift:228, 252), by the 120 s expiring, or by a runner restart. - The thresholds and the duration are
letconstants. No env var, config or CLI flag changes them.preferredBackend(the SDK snapshot option; daemon flag keysnapshotPreferredBackend) does override the plan, even under penalty (RunnerTests+SnapshotCapturePlan.swift:243-255), but the CLIsnapshotcommand doesn't expose it (still true in 0.21.28).
Evidence (runner.log)
- One
SNAPSHOT_XCTEST_CHANNEL_PENALIZED … reason=queries_backend_timeoutwas followed by 70PRIVATE_AX_SNAPSHOT_USEDcaptures in the next ~2 min. - One session's runner.log, covering several days and 43 runner launches, has 273
PENALIZEDlines (196queries_backend_timeout, 72tree_backend_timeout, 5slow_tree_capture_…) against 7PENALTY_CLEARED. All 50 penalties that re-armed inside 120 s aretree_backend_timeout. Most of thequeries_backend_timeoutones come shortly after the previous penalty expired (median about 21 s). 41,053 of 57,766 snapshot commands loggedXCTEST_CHANNEL_DEFERRED. Another session's log has 115PENALIZED(60 / 51 / 4) against 1 cleared.
Related: #1542.
Requests
- Make the slow threshold and the penalty duration configurable (env or CLI / session option).
- Don't penalize the channel for a single 1 s query-sweep timeout alone, and don't let the 1 s recovery probe re-arm the penalty.
- Expose
preferredBackendon the CLIsnapshotcommand (and as a session default), so a client can forcerecursiveTreefor steps that need an accurate, top-most-screen tree. - Optionally, mark private-AX nodes that belong to a covered (non-top-most) presented screen, so clients can filter them out. (0.21.28's
presentedSurfacefact, #3565, may cover part of this; not yet tested on our side.)
Happy to provide more logs or test a nightly.
- Langage dominant
- TypeScript
- Étoiles
- 5.1k
- Forks
- 339
- Merge moyen
- 11 h 59 min
- PR mergées (30 j)
- 736
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de callstack/agent-device
-
Limrun iOS fill reports success but drops non-ASCII textPeut-être pris @mvanhorn l’a pris aujourd’hui. Ouvertebug ready-for-agent
Difficulté 2/5 1-3 heures Accessibilité débutants 87/100
callstack/agent-device#3819 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
callstack/agent-device#1869 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 1-2 jours Accessibilité débutants 68/100
callstack/agent-device#3883 ·
Les mainteneurs répondent en général sous 1 jour
-
Track held execution locks in keyed-lock instead of a request-level registryPeut-être pris @thymikee l’a pris aujourd’hui. Ouverteneeds-triage
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
callstack/agent-device#3876 ·
Les mainteneurs répondent en général sous 1 jour
-
needs-triage
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 24/100
callstack/agent-device#3871 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de callstack/agent-device
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
chaitin/MonkeyCode#1437 ·
Les mainteneurs répondent en général sous 1 jour
-
rtdb-info-connected-order test: unhandled 'connection is closed' rejection fails the CLI suiteOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
carbon-design-system/carbon-ai-chat#2615 ·
Les mainteneurs répondent en général sous 1 jour
-
e2e-failure ready-to-code
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
redhat-developer/rhdh-plugin-export-overlays#4486 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offlinePeut-être pris @r2jaff l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
ComposioHQ/composio#5054 ·
Les mainteneurs répondent en général sous 1 jour