Search code examples
laravelseleniumdockerphpunitlaravel-dusk

After tests chrome process remains Laravel Dusk in a Docker container


After running Dusk tests with Atlassian Bamboo, Chrome process remains as "zombies".

Bellow my driver code initialization:

$options = (new ChromeOptions())
           ->addArguments(['--disable-gpu', '--headless', '--no-sandbox', ]);

$chrome = DesiredCapabilities::chrome()
          ->setCapability(ChromeOptions::CAPABILITY,$options)
          ->setCapability('acceptInsecureCerts', true);

return RemoteWebDriver::create('http://localhost:9515', $chrome);

My composer.json:

"require-dev":{
   "barryvdh/laravel-ide-helper":"^2.5",
   "filp/whoops":"^2.0",
   "fzaninotto/faker":"^1.4",
   "laravel/dusk":"^4.0",
   "mockery/mockery":"^1.0",
   "nunomaduro/collision":"^2.0",
   "phpunit/phpunit":"^7.0",
   "squizlabs/php_codesniffer":"3.*"
}

Bellow a screenshot to prove zombies processes:

Result of top command:

Result of top command

Thanks for reply.


Solution

  • After digging, it seems that the cause was a missing flag on a Docker container:

    You MUST append to your docker run the flag --init

    From the official Atlassian documentation: atlassian/bamboo-server

    Note that the --init flag is required to properly reap zombie processes.