Skip to content

Conversation

@radical
Copy link
Member

@radical radical commented Oct 29, 2020

When starting chrome via selenium+chromedriver, it seems to crash
inexplicably (dotnet/runtime#43955).
As a workaround, let's retry that a few times.

Also, adds --no-sandbox from #340 .

When starting chrome via selenium+chromedriver, it seems to crash
inexplicably (dotnet/runtime#43955).
As a workaround, let's retry that a few times.
@radical
Copy link
Member Author

radical commented Oct 29, 2020

/cc @lewing @akoeplinger

@akoeplinger
Copy link
Member

akoeplinger commented Oct 29, 2020

I don't think we should be adding --no-sandbox as the docs say:

A common cause for Chrome to crash during startup is running Chrome as root user (administrator) on Linux.
While it is possible to work around this issue by passing '--no-sandbox' flag when creating your WebDriver session,
such a configuration is unsupported and highly discouraged.
Please configure your environment to run Chrome as a regular user instead.

We're definitely not running Chrome as root so I'm a bit hesitant to add this highly discouraged option. The retry should hopefully fix it too.

{
return (driverService, new ChromeDriver(driverService, options, _arguments.Timeout));
}
catch (WebDriverException wde) when (wde.Message.Contains("exited abnormally") && retry_num < max_retries - 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we make this check for failed to start: exited abnormally so we don't accidentally retry other cases of abnormal exits, e.g. if the browser crashes due to some WASM bug while running tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is catching exceptions only while starting the browser, before any page gets opened.

@akoeplinger
Copy link
Member

.. and remove `--no-sandbox`, as that seems to be discouraged in the
docs.
@radical
Copy link
Member Author

radical commented Oct 29, 2020

I have removed --no-sandbox, and added some extra arguments for chrome based on @akoeplinger's comment. I removed the ones that seem to be passed already (by chromedriver/selenium?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants