Skip to content

(webdriver): find good known version when Chromedriver can't be installed with found buildId#10902

Merged
christian-bromann merged 22 commits intomainfrom
cb-known-good-version-fallback
Aug 11, 2023
Merged

(webdriver): find good known version when Chromedriver can't be installed with found buildId#10902
christian-bromann merged 22 commits intomainfrom
cb-known-good-version-fallback

Conversation

@christian-bromann
Copy link
Member

Proposed changes

We have observed in CI that a Chrome browser is found on the machine, e.g. v115.0.5790.171 but a driver with the same buildId doesn't exist. In this case let's make the driver manager a bit more versatile and have it detect the next known good version.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

n/a

Reviewers: @webdriverio/project-committers

@christian-bromann christian-bromann added the PR: Bug Fix 🐛 PRs that contain bug fixes label Aug 9, 2023
@harsha509
Copy link
Member

Hi @christian-bromann ,

I faced the issue previously and my chrome version was v115.0.5790.171 and I missed to place browserVersion and it was trying to download v115.0.5790.171

on placing the browserVersion: "stable" downloads correct version 115.0.5790.170 .

Just curious if this was the same case.

Will this PR does downloads the stable version ignoring browserVersion ?

Thanks,
Sri

@christian-bromann
Copy link
Member Author

@harsha509 yes, this is the same case. When WebdriverIO detects a Chrome browser on the machine it doesn't seem to be guaranteed that there is a Chromedriver with the same buildId. For this case this patch will find a last good known version for it to execute.

Copy link
Contributor

@HannaTarasevich HannaTarasevich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on this PR, I'm closing this one #10899

throw new Error(`Couldn't find known good version for Chromedriver v${majorVersion}`)
}
loggedBuildId = knownGoodVersion.version
return install({ ...chromedriverInstallOpts, buildId: loggedBuildId })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a case when known good version has already been installed and can be used from cache?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaik the install method looks into the cache and returns an available cached version if available.

Copy link
Contributor

@HannaTarasevich HannaTarasevich Aug 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So for this way, console won't contain message about the version of Chromedriver in use, right?
Like we have for else flow in row 118 or row 92 for simple download

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loggedBuildId will contain the used version which is initially buildId and will be updated if we desire to download chromedriver and fail doing so.

Copy link
Contributor

@HannaTarasevich HannaTarasevich Aug 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutly clear, but it was more about console messages in case of success for this flow (message about downloading specified version, then message about attempt to find good other version, but after that maybe it could be useful to have console.log about downloading version or used version from cache).
Anyway, this solution looks really good for me 👍

@christian-bromann christian-bromann force-pushed the cb-known-good-version-fallback branch 2 times, most recently from e3a5494 to a592532 Compare August 11, 2023 00:34
@christian-bromann christian-bromann merged commit 7fa274d into main Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Bug Fix 🐛 PRs that contain bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants