You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ios-runner): runMainThreadWork reports MAIN_THREAD_TIMEOUT for work that finished at the timeout boundary #2782
In apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+MainThreadWork.swift:94-114, after semaphore.wait times out, the code takes the lock and reads workState.finished. It uses that value only for abandoned-work accounting. It then throws timeoutError() unconditionally at :114. If the main block finishes after the semaphore times out but before the lock is taken, it has already stored its result, and that result is thrown away. A tap that actually happened is reported as MAIN_THREAD_TIMEOUT (see RunnerTests+Transport.swift:287-300). A daemon retry can then perform the gesture a second time.
Line references are at 01328de411.
Required behavior
On the timeout branch, if workState.finished is true under the lock, return or rethrow the stored result exactly as the non-timeout path does. Do not count the work as abandoned, and do not call onAbandoned.
Only work that is still unfinished under the lock is abandoned and throws the timeout error.
Do not change any timeout value.
Completion conditions
A unit test makes the block finish between the semaphore timeout and the lock. It can do this with an injected wait or a test seam in the existing style. The test asserts that the result is returned and that the abandoned count is unchanged.
Existing abandoned-work and busy-gate tests still pass.
Run pnpm check:xctest-selection, build the runner, and run the runner unit tests on the macOS host lane (see docs/agents/testing.md for signing and permissions). Add or change tests under the existing #if AGENT_DEVICE_RUNNER_UNIT_TESTS guard. Do not keep a second list of test names.
Activity
fix(ios-runner): answer main-thread work that finished at the timeout…
fix(ios-runner): answer main-thread work that finished at the timeout…
fix(ios-runner): answer main-thread work that finished at the timeout…
fix(ios-runner): return work that finished at the timeout boundary an…