Skip to content

Commit d670a70

Browse files
authored
[dotnet] Close dev tools session safely (#12660)
1 parent cef99fc commit d670a70

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

dotnet/src/webdriver/Chromium/ChromiumDriver.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public void CloseDevToolsSession()
323323
{
324324
if (this.devToolsSession != null)
325325
{
326-
this.devToolsSession.StopSession(true).ConfigureAwait(false).GetAwaiter().GetResult();
326+
Task.Run(async () => await this.devToolsSession.StopSession(true)).GetAwaiter().GetResult();
327327
}
328328
}
329329

dotnet/src/webdriver/Firefox/FirefoxDriver.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ public void CloseDevToolsSession()
415415
{
416416
if (this.devToolsSession != null)
417417
{
418-
this.devToolsSession.StopSession(true).ConfigureAwait(false).GetAwaiter().GetResult();
418+
Task.Run(async () => await this.devToolsSession.StopSession(true)).GetAwaiter().GetResult();
419419
}
420420
}
421421

dotnet/src/webdriver/Remote/RemoteWebDriver.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ public void CloseDevToolsSession()
475475
{
476476
if (this.devToolsSession != null)
477477
{
478-
this.devToolsSession.StopSession(true).ConfigureAwait(false).GetAwaiter().GetResult();
478+
Task.Run(async () => await this.devToolsSession.StopSession(true)).GetAwaiter().GetResult();
479479
}
480480
}
481481

0 commit comments

Comments
 (0)