Repository navigation
fix: pause newCommandTimeout during mobile: activateApp/launchApp - #940
Merged
KazuCocoa merged 1 commit intoOct 19, 2026
Merged
Conversation
The mobile:(activateApp|launchApp) branch of executeCommand bypasses BaseDriver.executeCommand, so the FlutterDriver newCommandTimeout kept running while reConnectFlutterDriver waited for the observatory URL. When that wait exceeded the timeout (60s by default), the session was deleted mid-command. Clear the timeout for the whole command and restart it in a finally block, as the proxy branch already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KazuCocoa
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
mobile:(activateApp|launchApp)branch ofFlutterDriver#executeCommandbypassesBaseDriver.executeCommand, so the FlutterDrivernewCommandTimeoutis never cleared while thecommand runs.
reConnectFlutterDrivercan wait for the observatory URL for up tomaxRetryCount × retryBackoffTime, and once that exceedsnewCommandTimeout(60s by default)the session is deleted in the middle of the command.
Since #936 made
mobile: launchAppgo through this branch, this is easier to hit. In a fork'siOS functional run, the session was torn down 60s after
mobile: launchApp:and the reconnect that finished later failed against the deleted session.
Fix
Clear the timeout before proxying the command and restart it in a
finallyblock, the same waythe proxy branch of
executeCommandalready does. The timeout is restarted even when thereconnect throws.
Tests
driver/test/mobile-launch-app.test.mjsnow also asserts the orderclearNewCommandTimeout → proxied command → startNewCommandTimeoutwhen the reconnect fails.That case fails on the current
mainand passes with this change.🤖 Generated with Claude Code