dusk: Facebook\WebDriver\Exception\NoSuchDriverException: no such session

Hi,

I’m starting to scaffold a suite of browser tests for a project, however when I run the full suite via php artisan dusk 90% of the tests fail to due what seems like a race condition.

10) Tests\Browser\RegisterTest::testPublicCanRegister
Facebook\WebDriver\Exception\NoSuchDriverException: no such session
  (Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Mac OS X 10.12.3 x86_64)

/Users/owen/Sites/footy-finance/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:100
/Users/owen/Sites/footy-finance/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:321
/Users/owen/Sites/footy-finance/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:597
/Users/owen/Sites/footy-finance/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:373
/Users/owen/Sites/footy-finance/vendor/laravel/dusk/src/Browser.php:186
/Users/owen/Sites/footy-finance/vendor/laravel/dusk/src/TestCase.php:143
/Users/owen/Sites/footy-finance/vendor/laravel/framework/src/Illuminate/Support/Collection.php:244
/Users/owen/Sites/footy-finance/vendor/laravel/dusk/src/TestCase.php:144
/Users/owen/Sites/footy-finance/vendor/laravel/dusk/src/TestCase.php:90
/Users/owen/Sites/footy-finance/tests/Browser/RegisterTest.php:65

If I run the tests class by class like php artisan dusk tests/Browser/RegisterTest.php they always work.

It just seems when they’re all together they expect your computer to be consistently fast and be able to spin up a chrome instance and load the page before the timeout.

Is there anyway we can make it so it slows down/waits a little longer before trying to run the tests?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 21 (4 by maintainers)

Most upvoted comments

I found a solution for this: in my gitlab-runner i have put

shm_size = 536870912

that fixed all “no sessions” errors.

This is my gitlab-runner for docker. @lsfiege

config.toml

concurrent = 1
check_interval = 0

[[runners]]
  name = "google-gitlab-runner"
  url = "https://xxxxxx/"
  token = "xxxxxxx"
  executor = "docker"
  environment = ["COMPOSER_CACHE_DIR=/cache"]
  [runners.docker]
    tls_verify = false
    image = "php:7.0"
    privileged = true
    security_opt = ["seccomp:unconfined"]
    disable_cache = false
    cache_dir = "/cache"
    volumes = ["/var/cache:/cache:rw"]
    shm_size = 536870912
[runners.cache]

I run this docker image

@hemoali if your problem isn’t resolved by adding a sleep() then your issue is probably something different, so probably worth posting your full issue

This issue is very random even in docker it just happens ever now and then, nothing seem to fix, it.