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

OSOE-840: Fix Chrome processes remaining after test runs #360

Merged
merged 5 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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