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

Chromedriver leaves forked Chrome instances hanging in background after test run (with large CPU load) #5600

Closed
garrymann opened this issue Mar 12, 2018 · 13 comments

Comments

@garrymann
Copy link

garrymann commented Mar 12, 2018

Meta

OS:
Microsoft Windows [Version 10.0.16299.248] x64
Selenium Version:
2.53.1
Browser:
Chrome 65 x64
Browser Version:
Version 65.0.3325.146 (Official Build) (64-bit)
Additional rerequisites:

  • ChromeDriver (2.36)
  • NodeJS (v8.10.0)
  • cucumber@1.3.3
  • protractor@5.3.0

Expected Behavior -

  1. The chromedriver.exe should stop and its Chrome instances as well.

Actual Behavior -

  1. The chromedriver.exe stops 4-5 secs after the tests completed. Then the forked Chrome instances stay in the background as running processes with huge CPU usage.

Steps to reproduce -

  1. Run at least 1 failing test with CucumberJS and Protractor.
    note: I'm running e2e tests against an Angular 1.6 application
  2. Examine the processes in Task manager.

Note:

This issue was introduced by the latest Chrome and ChromeDriver update. No symptomps were present in previous versions.

Screenshot:

Actual result

@cgoldberg
Copy link
Contributor

Run at least 1 failing test with CucumberJS and Protractor.

does your code always call quit() on the driver instance when a test fails? (usually done as a teardown/cleanup fixture in your framework)

@garrymann
Copy link
Author

@cgoldberg Hi!
The .quit() is handled by Protractor as far as I know. So it is not necessary since runner teardownEnv will take care of that for you.

@barancev
Copy link
Member

If you (or Protractor) called quit, but chromedriver could not stop the browser -- report this issue to chromedriver: https://sites.google.com/a/chromium.org/chromedriver/help

@garrymann
Copy link
Author

@barancev Done. Thanks.
https://bugs.chromium.org/p/chromedriver/issues/detail?id=2311

Things I've tried but did not resolve the issue:
reinstall chrome (v65 x64)
disable and remove extensions
run it without a single chrome instance open in the background
delete npm-cache
redo npm i
update to npm 5.7 (latest)
update to node 8 (latest LTS)
update windows 10: Version 10.0.16299.248

Any other ideas?

@cgoldberg
Copy link
Contributor

cgoldberg commented Mar 13, 2018

it is not necessary since runner teardownEnv
will take care of that for you

and what happens when something crashes unexpectedly and your teardown isn't called?

@garrymann
Copy link
Author

garrymann commented Mar 14, 2018

tried to call the quit manually as a hook but it can't reach the instance by this time:
this.registerHandler('AfterFeatures', () => { logger.warn('Force closing ChromeDriver.'); return browser.driver.quit(); });

So in conclusion nothing happens. After trying many workarounds (and sticking to the latest versions) I guess Google Chrome needs to fix stuff with Chrome and Chromedriver then.

Thanks anyway!

@farmazonne
Copy link

FYI: Don't know why but deleting arg "--no-sandbox" fixed the issue for me.

@nolmit
Copy link

nolmit commented May 17, 2018

removing "no-sandbox" helped for me too

@Vishwa1
Copy link

Vishwa1 commented Jun 6, 2018

I was facing the same issue and was so annoyed with it. Had to always keep an eye on CPU usage and kill the process. However, removing "no-sandbox" resolved my problem too.

@elsticky
Copy link

Saw the same problem, also removed --no-sandbox from my protractor config and the high CPU load disappeared. Took a long time to find this out since the problem started occurring previous week and the --no-sandbox place was already in there for a month or so.

@gtgunarathna
Copy link

i don't have --no-sandbox in any of Protractor settings file.

When executing test CPU goes to 100%.

is there any other place I should remove the this config

AnthonyL22 pushed a commit to AnthonyL22/core-microservice that referenced this issue Sep 18, 2018
@jmhdez
Copy link

jmhdez commented Oct 29, 2018

I don't know why, but when I add --disable-gpu the problem goes away.

@TARIFABBAS
Copy link

TARIFABBAS commented Nov 15, 2018

After removing --no-sandbox from chrome options, there is coming problem in opening chrome browser on windows 7 while on windows 8 and above it is working fine.
Anyone, have encounter the same problem and what's the solution?

@lock lock bot locked and limited conversation to collaborators Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests