Skip to content
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

[Problem/Bug]: Test failures with Latest Edge Canary (133.0.3010.0 canary) #5018

Open
charleshoangms opened this issue Dec 24, 2024 · 0 comments
Assignees
Labels
bug Something isn't working regression Something used to work but doesn't anymore

Comments

@charleshoangms
Copy link

What happened?

Some of our test cases started failing with latest versions of Edge Canary with the error as mentioned below:

Message: 
OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:55137/session timed out after 60 seconds.
----> System.Threading.Tasks.TaskCanceledException : The request was canceled due to the configured HttpClient.Timeout of 60 seconds elapsing.
----> System.TimeoutException : The operation was canceled.
----> System.Threading.Tasks.TaskCanceledException : The operation was canceled.
----> System.IO.IOException : Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
----> System.Net.Sockets.SocketException : The I/O operation has been aborted because of either a thread exit or an application request.

Stack Trace: 
HttpCommandExecutor.Execute(Command commandToExecute)
DriverServiceCommandExecutor.Execute(Command commandToExecute)
WebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) WebDriver.StartSession(ICapabilities capabilities) WebDriver.ctor(ICommandExecutor executor, ICapabilities capabilities) ChromiumDriver.ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout) EdgeDriver.ctor(EdgeDriverService service, EdgeOptions options, TimeSpan commandTimeout) EdgeDriver.ctor(EdgeDriverService service, EdgeOptions options) EdgeDriver.ctor(EdgeOptions options) EdgeDriverAccessor.SetUpEdgeDriver(EdgeOptions options) line 166 EdgeDriverAccessor.CreateWebDriver(Int32 remoteDebuggingPort, String browserId, Boolean popUpDialog, Int32 retryCount) line 65 <<RunTaskAsync>b__0>d.MoveNext() line 255 --- End of stack trace from previous location --- EdgeDriverAccessor.RunTaskAsync[TResult](Func1 func) line 253
EdgeDriverAccessor.IsElementAvailableBySpecified(By by) line 1217
<b__0>d.MoveNext() line 101
--- End of stack trace from previous location ---
Wait.For(Func1 predicate, Func1 description, Int32 timeoutInMilliseconds, Int32 pollingDelayInMilliseconds) line 100
Wait.For(Func1 predicate, Func1 description, Int32 timeoutInMilliseconds) line 71
Wait.For(Func1 predicate, String description, Int32 timeoutInMilliseconds) line 61 Wait.For(Func1 predicate, String description) line 150
WebDriverAccessorUtils.WaitForElementBySpecified(IWebDriverAccessor webDriverAccessor, By by) line 100
LibrarySelectorController.SelectLibrary(String libraryName) line 33
AudienceGroupAssociationEntityController.AddNewFromUI(AccountTreeSelectionScope selectionScope, String campaignName, String assetGroupName, String audienceGroupName) line 35
UIAudienceGroupAssociation.AddToDataGrid(IAudienceGroupAssociationEntityController controller, AccountTreeSelectionScope status) line 38
CreateBasicEntities.CreateNewAudienceGroupAssociation(IApplicationController appController, Func2 assetGroupFilter) line 1487 <<AudienceGroupAssociation>b__2>d.MoveNext() line 200 --- End of stack trace from previous location --- UndoRedoHelper.OrchestrateTestScenario(IApplicationController appController, Func1 originalTask, Func1 undoRedoTask) line 24 UndoRedoHelper.AudienceGroupAssociation(IApplicationController appController, Boolean isUndo) line 196 CreateBasicEntityTests_Parents_Ads_UndoRedo.AudienceGroupAssociationRedoInner(App app) line 151 <<ExecuteApplicationTest>b__6>d.MoveNext() line 440 --- End of stack trace from previous location --- UITestBase.ExecuteApplicationTest(Func2 test, Boolean isTestMode, UInt32 iterations, Func2 additionalConfigs, Boolean throwTestException, List1 perDevicePilotsOverride, List`1 percentagePilotsOverride, Action additionalMocks, Boolean isBackgroundLaunch, Boolean shouldMockOAuthManager) line 516
CreateBasicEntityTests_Parents_Ads_UndoRedo.AudienceGroupAssociationRedoCRUD() line 143
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
--TaskCanceledException
HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
HttpClient.g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
<b__0>d.MoveNext()
--- End of stack trace from previous location ---
HttpCommandExecutor.Execute(Command commandToExecute)
--TimeoutException
--TaskCanceledException
HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
HttpClient.g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
--IOException
AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
Int32>.GetResult(Int16 token)
HttpConnection.InitialFillAsync(Boolean async)
HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
--SocketException

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Prerelease (Edge Canary/Dev/Beta)

Runtime Version

133.0.3010.0 canary

SDK Version

1.0.2420.47

Framework

Win32

Operating System

Windows 11

OS Version

No response

Repro steps

WebDriverManager version : 2.17.2
Selenium.WebDriver Version=4.18.1

As our open multiple instances of webview, I did observe instances of successful start of edge drivers on multiple ports, the timeout occurs on latest port where edge driver were started. Sharing log reference below:

image

Also sharing the Screen which we encounter when this run fails:

Image (1)

C# code to instantiate the edge driver in the tests
`//Instantiating

EdgeOptions options = new EdgeOptions();
options.UseWebView = true;
options.DebuggerAddress = "localhost:" + remoteDebuggingPort;
options.AddArgument("--log-level=3");
options.AddArgument("--verbose");
try
{
this.logger.LogInfo(null, $"EdgeDriver for WebView2/Edge version: {WV2Helper.GetWebView2FullVersion()}");
this.webDriver = new EdgeDriver(options: options);
}
catch
{
this.webDriver = await this.SetUpEdgeDriver(options);
}

//set up edge driver
private async Task SetUpEdgeDriver(EdgeOptions options)
{
EdgeDriver driver;
try
{
this.DownloadEdgeDriver();
driver = new EdgeDriver(options: options);
}
catch (Exception ex)
{
//this.logger.LogException(null, ex, $"SetUpEdgeDriver");
if (WV2CanaryHelper.IsUsingEdgeCanary())
{
var versionToDownload = await WV2CanaryHelper.GetLatestCanaryVersion();
this.DownloadEdgeDriver(0, versionToDownload);
}
if (ex is WebDriverException || ex.Message.Contains("This version of Microsoft Edge WebDriver only supports Microsoft Edge version"))
{
if (!WV2CanaryHelper.IsUsingEdgeCanary())
{
var versionToDownload = WV2Helper.GetWebView2VersionNumber();
this.logger.LogInfo(null, $"SetUpEdgeDriver to download Prod Driver version: {versionToDownload}");
this.DownloadEdgeDriver(0, versionToDownload);
}
driver = new EdgeDriver(options: options);
}
else if (ex is WebException || ex is IOException)
{
driver = new EdgeDriver(options: options);
}

return driver;

}

//Download edge driver
private void DownloadEdgeDriver(int retryCount = 0, string versionToDownload = null)
{
try
{
if (!string.IsNullOrEmpty(versionToDownload))
{
new DriverManager().SetUpDriver(new EdgeConfig(), versionToDownload);
}
else
{
new DriverManager().SetUpDriver(new EdgeConfig());
}
}
catch (Exception ex)
{
this.logger.LogException(null, ex, $"DownloadEdgeDriver with versionToDownload: {versionToDownload} retryCount: {retryCount}");
if (retryCount < MaxRetries)
{
this.DownloadEdgeDriver(retryCount + 1, versionToDownload);
}
else
{
throw;
}
}
}`

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Regression in newer Runtime

Last working version (if regression)

132.0.2957.41

@charleshoangms charleshoangms added the bug Something isn't working label Dec 24, 2024
@github-actions github-actions bot added the regression Something used to work but doesn't anymore label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Something used to work but doesn't anymore
Projects
None yet
Development

No branches or pull requests

2 participants