Skip to content

Fix CI: pin ChromeDriver to runner's Chrome version - #1

Merged
eshanclio merged 2 commits into
mainfrom
fix/chromedriver-version-pin
Aug 17, 2026
Merged

eshanclio merged 2 commits into
mainfrom
fix/chromedriver-version-pin

Conversation

@eshanclio

Copy link
Copy Markdown
Owner

Root cause

The integration-test job's "Install and start chromedriver" step failed with:

SessionNotCreatedException (500): session not created: This version of ChromeDriver only supports Chrome version 152. Current browser version is 151.0.7922.108

The step installed chromedriver@stable, which tracks the latest ChromeDriver release. That release can be ahead of the Chrome binary pre-installed on the ubuntu-latest runner 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

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.
@eshanclio
eshanclio merged commit d36182d into main Aug 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant