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

Killing child returned by start() leaves chromedriver process running #351

Closed
prantlf opened this issue Mar 21, 2018 · 2 comments
Closed

Comments

@prantlf
Copy link

prantlf commented Mar 21, 2018

Expected Behavior

The process returned by the start method should be enough to stop all additional child processes started by calling its kill method. Example of an expected usage:

const selenium = require('selenium-standalone')
selenium.start({...}, function (error, child) {
  if (!error) {
    // work with webdriverio and when finished, stop selenium:
    child.kill()
    // both selenium server and chromedriver process should exit
  }
})

Current Behavior

Killing the process returned by the start method stops the selenium server (java) but the chromedriver process remains running. This occurs only, if the selenium process was actually used before trying to stop it. In my example, using WebdriverIO for just initialising and uninitialising the driver was enough:

const webdriverio = require('webdriverio')
const client = webdriverio.remote({...})
client.init()
  .end()

If the driver usage by the above code was removed, both processes were stopped after calling the kill method of the returned child, as expected. Additionally, if a delay was introduced after calling the end method of the WebdriverIO client, the chromedriver process was topped too! It can be used as a workaround. Waiting for 1 ms was not enough, but waiting for 100 ms, or longer, helped:

const webdriverio = require('webdriverio')
const client = webdriverio.remote({...})
client.init()
  .end()
  .pause(100)

Steps to Reproduce

Create a testing directory, install latest versions of the following npm modules there, download selenium.test.js there, execute it and check for running selenium processes:

npm i selenium-standalone
npm i webdriverio
node selenium.test.js
ps ax | grep selenium

Only the grep selenium process should be printed, but the chromedriver process from the "node_modules/selenium-standalone/.selenium" directory is printed too.

I wrote comments in the attached script about what do modify there to help the chromedriver process stop.

Logs

Executing the attached script with extra logging prints more information - see selenium.test.txt - but no information about the process-stopping phase.

Testing Environment

Versions of Node.js and npm modules:

node:                8.10.0
npm:                 5.6.0
selenium-standalone: 6.13.0
webdriverio:         4.12.0

Operating system with latest updates applied:

$ lsb_release --all
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu Bionic Beaver (development branch)
Release:	18.04
Codename:	bionic
$ uname -a
Linux de08365 4.15.0-12-generic #13-Ubuntu SMP Thu Mar 8 06:24:47 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
prantlf added a commit to prantlf/grunt-html-dom-snapshot that referenced this issue Mar 27, 2018
Wait for 100ms before going on after ending webdrioverio client
See webdriverio/selenium-standalone#351 for more information.

Update npm modules.
@fractile81
Copy link

I have the same problem on Windows.

Versions:

node: 10.6.0
npm: 6.0.0
selenium-standalone: 6.15.1
chromedriver: 2.40

@mgrybyk
Copy link
Member

mgrybyk commented Oct 9, 2020

Please try the latest version.

Feel free to re-open if the issue persists.

Thanks!

@mgrybyk mgrybyk closed this as completed Oct 9, 2020
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

No branches or pull requests

3 participants