-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Fix chrome/selenium tests #25330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix chrome/selenium tests #25330
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#yolo
🤞 |
Just noticed the base branch. This is test-only and, if possible, we should have the Selenium tests running for 5.0 |
I was planning on trying things out in master before back-porting the fixes to release/5.0. |
<SeleniumWebDriverMicrosoftDriverPackageVersion>17.17134.0</SeleniumWebDriverMicrosoftDriverPackageVersion> | ||
<SeleniumWebDriverChromeDriverPackageVersion>2.43.0</SeleniumWebDriverChromeDriverPackageVersion> | ||
<SeleniumWebDriverPackageVersion>3.12.1</SeleniumWebDriverPackageVersion> | ||
<SeleniumWebDriverChromeDriverPackageVersion>85.0.4183.8300</SeleniumWebDriverChromeDriverPackageVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty big jump. Did something change with the way the package is versioned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, they moved to use versions matching Chrome versions. There as a jump from v.2.46.0 to v.71.0.3578.137 a while back.
In addition, we were almost 2 years out-of-date in using v2.43.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. That makes sense.
How does this mesh with the fact that we don't control what version of Chrome is downloaded with the installer (AFAIK)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should mean we can be proactive. Whenever a dev notices their Chrome installation wants to be restarted, they can check whether it's a new major version and update this particular package version. Or, @sebastienros could add a reminder to check the Selenium versions in his ops rotation invites every few (10?) rotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could, I am afraid I will forget ;) I would suggest to update the operations book, and let's say "if your rotation happens on the first Tuesday of the month then you should ..."
Mondays are frequently skipped due to holidays
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. May also need something in https://github.com/dotnet/aspnetcore-internal/blob/master/.github/ISSUE_TEMPLATE/Build_OPS_handoff.md @JunTaoLuo what do you think❔
Makes sense. Looks like you have at least one breaking change to handle. But, it's not that bad considering how far out of date we were. |
👀 |
@JunTaoLuo I suggest copying #25323 into the 'release/3.1' branch if possible (@Pilchie and @wtgodbe is that branch open for test-only changes at this point❔). Eventually we'll want this fix there too because it also uses Selenium and our InstallGoogleChrome.ps1 script. E.g. some of the errors in my attempted validation of #25217 mention @captainsafia other validation problems w/ #25217 require your #25324 fix i.e. everyone will need to include your commit in their 3.1 PRs or validations are just busted. Sooner it can go in (too), the better. But, again, only if branch is open. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Thanks for figuring this out, @JunTaoLuo!
3.1 isn't open for anything until we ship 3.1.8 |
Sounds like there's no rush to unblock 3.1 right now. I'll just continue with making fixes here and cherry-pick them to release/5.0 and 3.1 when it's done. |
I've updated the APIs but I'll work with @ajaybhargavb's to test it on Monday. |
@JunTaoLuo how far are we from having a commit we can |
This PR is failing the exact same way as before, unable to launch chrome and hanging. |
Looks like it is still trying to use the old chrome driver (2.43.xxx) instead of the new
|
b34bd79
to
150fd53
Compare
@JunTaoLuo's latest commit fixed the Chrome not being found issue but it is now throwing a null-ref,
Also only a subset of the tests failed. @captainsafia @pranavkm could these be test specific issues? |
Turns out that getting browser logs is broken: SeleniumHQ/selenium#7342. Seems like the issue is fixed in 4.0.0-alpha3 so I'll try that version and see what happens. |
Okay this got even further but now I'm seeing actual test failures in blazor templates and component e2e tests. |
Hey @javiercn, you've been recommended to take a look at the test failures. Can you investigate and see what's causing the test failures. Note that this is blocking us from turning the E2ETests on in 5.0-rc1 |
break; | ||
default: | ||
throw new InvalidOperationException($"Browser name {sauce.BrowserName} not recognized"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this? We ended up not going this route @ajaybhargavb isn't that the case?
We only need chrome I believe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only need Chrome for local and CI tests. But we use other browsers when running in SauceLabs. We need to pass in the correct options to SauceLabs in that case. DesiredCapabilities
used to be enough but that is now obsoleted in the newer version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajaybhargavb but do we actually run in SauceLabs? I thought we discarded that idea. That's why I'm asking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still want to. What we discarded was the idea to do real device testing on SauceLabs.
Actually I'll defer to @mkArtakMSFT in terms of assigning an investigator and which release this goes into. Current status: I'm seeing several Component.E2ETests and BlazorWasm template test failures with different Assert errors. It's unclear to me if these are caused by issues with the tests, issues with the product or something else. For example BlazorWasmStandaloneTemplate_Works fails without any error messages in its console log whereas BlazorWasmHostedPwaTemplate_Works fails at the same TestBasicNavigation step but there are messages in the console log saying |
Agreed but we also want to fix Selenium tests in release/3.1. The same-site fixes in @BrennanConroy and @captainsafia's #25324 aren't enough. Would rather not back-port #25323 into a servicing branch due to the loss of code coverage. |
@mkArtakMSFT Do we still need to assign an investigator for this? |
We urgently need an investigator because we're seeing the same issues in release/3.1 and that has a short timeline. @javiercn do you have time to help w/ the WASM template tests❔ |
I'll take a look tonight and see if I can find anything or at least narrow down the issue we're seeing. Also I'm curious if #25689 might contain some of the fixes that'll get this working. |
|
Seems like those didn't affect the test failures seen in this PR. I'll try to pin down the cause a little more clearly tomorrow. |
It didn't seem to fix the Components.E2ETests actually, I'm going to look into why today. |
d50f283
to
a24de39
Compare
Turns out the browser logs are not working. I might just disable the specific tests that checks logs to unblock the rest of the tests enabled by this PR while I investigate. |
@dougbu @mkArtakMSFT I suppose we want these fixes in rc2 as well? |
Yes, please! |
And, release/3.1 if possible ❕ |
* Revert "Disable failing/hanging tests due to Chrome/Selenium issue (#25323)" This reverts commit 332f150. * Update Selenium to latest * Update API * Try specifying a version * Update Selenium to 4.0.0-beta5 * Disable browser log tests * Fix components e2e tests and disable blazor standalone template test
* Fix chrome/selenium tests (#25330) * Revert "Disable failing/hanging tests due to Chrome/Selenium issue (#25323)" This reverts commit 332f150. * Update Selenium to latest * Update API * Try specifying a version * Update Selenium to 4.0.0-beta5 * Disable browser log tests * Fix components e2e tests and disable blazor standalone template test * Disable tests using browser log * Disable template test * Avoid using .NET formatted strings in tests * Annotate BasicTestApp suggesting that it needs the all globalization data * Culture specific formatting relies on the ICU data carried by the OS. This causes issues in our tests if WebAssembly carries a different set than the OS. Instead updating these tests to use hardcoded strings. * Additionally fixing an issue where some projects in the solution were using tasks from the .dotnet SDK rather than the local copy of the SDK. This was causing issues building locally. Co-authored-by: Pranav K <[email protected]>
Fixes #25322