Skip to content

Commit

Permalink
Add lock.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahelsaig committed Aug 4, 2023
1 parent a90736f commit da71a9f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lombiq.Tests.UI/Services/WebDriverFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace Lombiq.Tests.UI.Services;

public static class WebDriverFactory
{
private static readonly object _setupLock = new();

public static ChromeDriver CreateChromeDriver(BrowserConfiguration configuration, TimeSpan pageLoadTimeout)
{
ChromeDriver CreateDriverInner(ChromeDriverService service)
Expand Down Expand Up @@ -163,7 +165,7 @@ private static TDriver CreateDriver<TDriver>(string browserName, Func<TDriver> d
{
try
{
DriverSetup.AutoSetUp(browserName);
lock (_setupLock) DriverSetup.AutoSetUp(browserName);
return driverFactory();
}
catch (Exception ex)
Expand Down

0 comments on commit da71a9f

Please sign in to comment.