dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.33k stars 4.74k forks source link

WASM tests failing with `Chrome failed to start` #108859

Open ericstj opened 1 month ago

ericstj commented 1 month ago

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=840205 Build error leg or test failing: Common.Tests.WorkItemExecution Pull request: https://github.com/dotnet/runtime/pull/108797

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "OpenQA.Selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Sample log: https://helixre107v0xd1eu3ibi6ka.blob.core.windows.net/dotnet-runtime-refs-pull-108797-merge-b672a2c11f99427a9e/Microsoft.CSharp.Tests/1/console.618ae569.log?skoid=8eda00af-b5ec-4be9-b69b-0919a2338892&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2024-10-14T19%3A59%3A12Z&ske=2024-10-14T20%3A59%3A12Z&sks=b&skv=2024-05-04&sv=2024-05-04&st=2024-10-14T19%3A59%3A12Z&se=2024-10-14T20%3A59%3A12Z&sr=c&sp=r&sig=zPghjJW77UN3nV9xrZucrdLlqVHObIDrVvS37NXBv9k%3D

ChromeDriver was started successfully.
Connection refused [::ffff:127.0.0.1]:36887 (localhost:36887)
[15:11:06] warn: Failed to start the browser, attempt #0: OpenQA.Selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally.
                   (unknown error: DevToolsActivePort file doesn't exist)
                   (The process started from chrome location /datadisks/disk1/work/AC2B0958/p/chrome-linux/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
                    at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
                    at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
                    at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
                    at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
                    at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
                    at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)

Known issue validation

Build: :mag_right: https://dev.azure.com/dnceng-public/public/_build/results?buildId=840205 Error message validated: [OpenQA.Selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally] Result validation: :white_check_mark: Known issue matched with the provided build. Validation performed at: 10/14/2024 8:05:32 PM UTC

Report

Build Definition Test Pull Request
863852 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution dotnet/runtime#109620
863860 dotnet/runtime System.Diagnostics.TraceSource.Tests.WorkItemExecution
863848 dotnet/runtime Workloads-.WasmBuildAppTest.WorkItemExecution
2575696 dotnet-runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #44696
860323 dotnet/runtime Workloads-.WasmBuildAppTest.WorkItemExecution dotnet/runtime#109517
860319 dotnet/runtime Workloads-.WasmBuildAppTest.WorkItemExecution dotnet/runtime#109516
853522 dotnet/runtime System.Net.Mail.Unit.Tests.WorkItemExecution dotnet/runtime#109238

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 7
dotnet-policy-service[bot] commented 1 month ago

Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.

carlossanlop commented 1 month ago

This failure is heavily impacting the 6.0 PRs CI.

ilonatommy commented 1 week ago

The error can indicate a mismatch of chromedriver and chrome version. Failing tests are on Linux (we're not testing Windows at all). We are using chromedriver: 84.0.4147.0, chrome: Chromium 84.0.4147.0 there, so they are matching versions: https://github.com/dotnet/runtime/blob/9623ff9cd0fd8e75b5c5c1d950bd8d3a49233d9d/src/libraries/sendtohelixhelp.proj#L330

The main difference between net6 and current main is missing --no-sandbox argument that was added to xharness in https://github.com/dotnet/xharness/pull/951. It is reported as a fix for this exact error and it bypasses the OS's security model. I will backport the mentioned PR and see if this helps.