Skip to content

Commit

Permalink
Merge pull request #360 from Lombiq/issue/OSOE-840
Browse files Browse the repository at this point in the history
OSOE-840: Fix Chrome processes remaining after test runs
  • Loading branch information
Piedone authored Apr 30, 2024
2 parents f109d4d + 4246141 commit 938c867
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:

jobs:
publish-nuget:
uses: Lombiq/GitHub-Actions/.github/workflows/publish-nuget.yml@dev
uses: Lombiq/GitHub-Actions/.github/workflows/publish-nuget.yml@issue/OSOE-842
secrets:
API_KEY: ${{ secrets.DEFAULT_NUGET_PUBLISH_API_KEY }}
1 change: 1 addition & 0 deletions Lombiq.Tests.UI.Samples/Tests/MonkeyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public Task TestAdminBackgroundTasksAsMonkeyRecursivelyShouldWorkWithAdminUser()
&& !logEntry
.Message
.Contains("An invalid form control with name='LockExpiration' is not focusable.")
&& !logEntry.IsNotFoundLogEntry("/favicon.ico")
&& logEntry.Level != LogLevel.Info)
.ShouldBeEmpty());

Expand Down
10 changes: 3 additions & 7 deletions Lombiq.Tests.UI/Services/WebDriverFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ public static Task<ChromeDriver> CreateChromeDriverAsync(BrowserConfiguration co
{
Task<ChromeDriver> CreateDriverInnerAsync(ChromeDriverService service)
{
// Note that no-sandbox should NOT be used, because it causes Chrome processes to remain open, see
// https://github.com/Lombiq/UI-Testing-Toolbox/issues/356.

var chromeConfig = new ChromeConfiguration { Options = new ChromeOptions().SetCommonOptions() };

chromeConfig.Options.SetLoggingPreference(LogType.Browser, LogLevel.Info);

// Disabling the Chrome sandbox can speed things up a bit, so it's recommended when you get a lot of
// timeouts during parallel execution:
// https://stackoverflow.com/questions/22322596/selenium-error-the-http-request-to-the-remote-webdriver-timed-out-after-60-sec
// However, this makes the executing machine vulnerable to browser-based attacks so it should only be used
// with trusted code (like our own).
chromeConfig.Options.AddArgument("no-sandbox");

// Linux-specific setting, may be necessary for running in containers, see
// https://developers.google.com/web/tools/puppeteer/troubleshooting#tips for more information.
chromeConfig.Options.AddArgument("disable-dev-shm-usage"); // #spell-check-ignore-line
Expand Down

0 comments on commit 938c867

Please sign in to comment.