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

chrome process hangs forever #76

Open
beeflamian opened this issue Aug 11, 2016 · 19 comments
Open

chrome process hangs forever #76

beeflamian opened this issue Aug 11, 2016 · 19 comments

Comments

@beeflamian
Copy link

Karma seems have problem disconnecting chrome browser. It happened to me about every 10 tests run. I cannot constantly reproduce this problem

OS: CentOS7
Chrome: Google Chrome 52.0.2743.116
Karma chrome launcher: tried 1.0.1, 0.2.3, 0.1.4, and they all have the problem

Some log:
Finished in 3.517 secs / 2.243 secs

SUMMARY:
✔︎ 9 tests completed
DEBUG [karma]: Run complete, exitting.
DEBUG [launcher]: Disconnecting all browsers
DEBUG [launcher]: Disconnecting all browsers
DEBUG [launcher]: Disconnecting all browsers
...then wait forever

The process tree can be found here https://gist.github.com/beeflamian/336735330443814d442fe77fc8e5f9f4

karma config file can be found here
https://gist.github.com/beeflamian/180dc8565e39509c11ee61f6cf844f38

Does anyone have any suggestions? Thanks in advance!

@dignifiedquire
Copy link
Member

This sounds like the actual Chrome process gets somehow stuck, so that karma can't kill it with a regular signal. Have you checked if Chrome some hangs or reacts to a regular close command?

@beeflamian
Copy link
Author

@dignifiedquire Here's a high level note https://gist.github.com/beeflamian/07ebb8254e1f92d83296a85610b3fbfe

I've also tried to narrow it down by printing stacktrace of chrome. However, I only found chrome is pretty complex that has fingers everywhere. I suspect there is a dead lock among threads :(

@dignifiedquire
Copy link
Member

Yeah that looks like Chrome hangs itself for some reason. It's probably related to what is actually run inside your tests.

@myitcv
Copy link

myitcv commented Aug 19, 2016

I'm seeing the same thing.

Ubuntu 16.04.1 LTS
Google Chrome 53.0.2785.70 beta

The problem appears to be related to Chrome launching a subprocess (gcr-prompter) that prompts for a password to unlock my keychain (I believe this is something to do with gnome keyring support - I have no need for this)

Chrome spawns gcr-prompter. So even when the tests finish, gcr-prompter is still waiting for user input (their password), hence Chrome is waiting on gcr-prompter, hence why it doesn't die when expected, hence the resulting resort to sending SIGKILL.

My brute force solution to this was to remove the following packages:

libfolks-eds25 gnome-keyring seahorse gcr evolution-data-server oneconf python-ubuntuone-storageprotocol ubuntu-sso-client python-ubuntu-sso-client pinentry-gnome3

But it would seem cleaner to be able to launch Chrome in such a way that it does not try to kick start the gnome keyring process. I've no idea how to do that...

@voltrevo
Copy link

voltrevo commented Sep 6, 2016

@beeflamian @myitcv Can you repro in the latest Karma? It's possible you ran into this issue which was fixed: karma-runner/karma#2267.

@myitcv
Copy link

myitcv commented Sep 10, 2016

@voltrevo any reason why you think the two are related?

@ValeryVS
Copy link

karma 1.3.0
karma-chrome-launcher 2.0.0
Ubuntu 14.04.5 LTS
Google Chrome Version 53.0.2785.116 (64-bit)

It prompts for a password to unlock keychain.

But with Chromium (not Chrome) all ok. Also with karma 1.20.

karma 1.2.0
karma-chrome-launcher 2.0.0
Ubuntu 14.04.5 LTS
Chromium Version 52.0.2743.116 Built on Ubuntu , running on Ubuntu 14.04 (64-bit)

@michaelBenin
Copy link

Also running into this problem, first of all the docs on karma's 1.0 says it doesn't need anything to open chrome, which is wrong, you still need this plugin, tested on mac. Unfortunately on Ubuntu with the plugin and the CHROME_BIN set, it's having an issue. This was working with the older version of Karma.

Here's the stack trace I'm getting:

21 10 2016 16:41:14.622:INFO [karma]: Karma v1.3.0 server started at http://localhost:9876/
21 10 2016 16:41:14.624:INFO [launcher]: Launching browser Chrome with unlimited concurrency
21 10 2016 16:41:14.643:INFO [launcher]: Starting browser Chrome
21 10 2016 16:42:14.705:WARN [launcher]: Chrome have not captured in 60000 ms, killing.
21 10 2016 16:42:16.710:WARN [launcher]: Chrome was not killed in 2000 ms, sending SIGKILL.
21 10 2016 16:42:18.713:WARN [launcher]: Chrome was not killed by SIGKILL in 2000 ms, continuing.
[16:42:18] 'client-unit-test' errored after 1.08 min

@michaelBenin
Copy link

Also, should we open an issue on karma? In it's docs it says chrome comes with it.

@bennycode
Copy link

I got the same issue on Windows 10 with:

  • karma v1.7.1
  • karma-chrome-launcher v2.2.0

Screenshot:

unbenannt

Relevant Karma Browser config:

browsers: ['ChromeNoSandbox'],
customLaunchers: {
  ChromeNoSandbox: {
    base: 'ChromeHeadless',
    flags: ['--no-sandbox'],
  },
}

When my test suite is empty, then Chrome can be closed by Karma:

HeadlessChrome 0.0.0 (Windows 10 0.0.0): Executed 0 of 8 SUCCESS (0 secs / 0 secs)
HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR
Disconnected, because no message in 10000 ms.
HeadlessChrome 0.0.0 (Windows 10 0.0.0): Executed 0 of 8 DISCONNECTED (10.02 secs / 0 secs)
14 12 2017 14:16:46.860:WARN [karma]: Test suite was empty.

@thirusabari
Copy link

Hi @bennyn ,

flags: ['--no-sandbox'] was not worked for me.

Still I am getting same Error in Chromeheadless

Thanks

@ribrdb
Copy link

ribrdb commented Jun 25, 2018

I fixed this on darwin by using the chrome flag --use-mock-keychain
For linux --password-store=basic sounds like it might work.

@govindrai
Copy link

Any concrete solution to this? This is still happening for me.

@chirilaalexandru90
Copy link

Any concrete solution to this? This is still happening for me.

Same problem

@lfdantoni
Copy link

Any concrete solution to this? This is still happening for me.

same problem to me

@joeldlc
Copy link

joeldlc commented Sep 10, 2019

Any concrete solution to this? This is still happening for me.

same problem to me

Same problem.

@tobiasetter
Copy link

Any concrete solution to this? This is still happening for me.

same problem to me

Same problem.

same for me

@alex-jesper
Copy link

alex-jesper commented Jan 10, 2020

Setting

singleRun: true

Did the trick for for me

@tmagandr
Copy link

same problem for me too. Any solution appreciated?

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