Selenium tests timing out

We run some functional tests in chrome using selenium through nightwatch.js. We’re running selenium 3.0.1 and chromedriver 2.24.

The problem is that roughly half of the time the build times out while running these tests. No error is shown and we don’t encounter that problem locally or on Travis CI, which makes me suspect it might be an issue with Circle Ci. When I killed either selenium or chrome when testing locally, it produced an error that was logged to the terminal.

I’m happy to provide more information if needed. Hope someone knows how to solve this issue.

Can you add the following environment variable to your project:

DBUS_SESSION_BUS_ADDRESS = /dev/null

You can do this via the CircleCI UI: Project settings > Environment Variables

Or in circle.yml:

machine:
  environment:
    DBUS_SESSION_BUS_ADDRESS: /dev/null

Do let us know if that helps or not. Our testing suggests that this resolves issues related to x11-dbus and Xvfb in containerized environments with flaky browser testing using Selenium, Chrome / Firefox.

Thanks for the help. We for now fixed the issue by using a new PR for our testing framework that handles timeouts in session retrieval more gracefully. We still will try out your suggestion though (it’s even better if there are now timeouts in the communication with selenium to begin with).