Repository navigation
Fix CI: pin ChromeDriver to runner's Chrome version - #1
Merged
Merged
Conversation
The integration-test job installed chromedriver@stable, which tracks the latest ChromeDriver release. That release can be ahead of the Chrome binary pre-installed on the GitHub Actions runner image, since the two are updated on independent schedules. When they drift apart, ChromeDriver refuses to start a session against a Chrome major version it doesn't support: SessionNotCreatedException (500): session not created: This version of ChromeDriver only supports Chrome version 152. Current browser version is 151.0.7922.108 Detect the actual Chrome major version on the runner and install the matching ChromeDriver major version instead of always fetching @stable, so the two stay in sync regardless of future image updates.
After fixing the ChromeDriver version mismatch, the integration-test
job progressed further but still failed: the todo never got added
during the test, even though no error was thrown.
Root cause: the test drives text entry via WidgetTester.enterText and
receiveAction, which inject fake text-input platform messages tagged
with a magic client id of -1. Flutter's framework only honors that id
inside an `assert(() { ... }())` block in services/text_input.dart —
and Dart strips asserts entirely in --release and --profile builds.
So under --release, the synthetic keystrokes this test sends are
silently dropped: the TextField's controller never receives "Buy
milk", `_submit()` sees an empty string and returns early, and the
todo list stays empty with no exception anywhere in the chain.
Verified locally: the same test fails identically in --release and
--profile, and passes in plain debug mode (the default for `flutter
drive` with no mode flag), where the assert — and its -1 escape
hatch — is compiled in.
Drop --release from the `flutter drive` invocation so the test can
actually exercise text entry.
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.
Root cause
The
integration-testjob's "Install and start chromedriver" step failed with:The step installed
chromedriver@stable, which tracks the latest ChromeDriver release. That release can be ahead of the Chrome binary pre-installed on theubuntu-latestrunner image, since Chrome and ChromeDriver stable channels are updated on independent schedules. When they drift apart, ChromeDriver refuses to start a session against a Chrome major version it doesn't support.Fix
Detect the actual Chrome major version installed on the runner via
google-chrome --version, and install the matching ChromeDriver major version instead of always fetching@stable. This keeps the two in sync regardless of future runner image updates on either side.Verified locally that
@puppeteer/browsers install chromedriver@<major>correctly resolves to the latest patch build for that major version (e.g.chromedriver@151→151.0.7922.138).Failing run: https://github.com/eshanclio/flutter-boilerplate/actions/runs/31867660291/job/94971184551