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

Google Chrome 75.0.3770.80 HEADLESS connecting but not running tests inside Docker. #3328

Closed
josh08h opened this issue Jun 6, 2019 · 12 comments

Comments

@josh08h
Copy link

josh08h commented Jun 6, 2019

Expected behaviour

I have built a new docker image which has picked up the latest version of Chrome (Google Chrome 75.0.3770.80).

Actual behaviour

05 06 2019 18:11:33.952:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
05 06 2019 18:11:33.953:INFO [launcher]: Launching browser chrome_no_sandbox with unlimited concurrency
05 06 2019 18:11:34.006:INFO [launcher]: Starting browser ChromeHeadless
05 06 2019 18:11:34.390:INFO [HeadlessChrome 75.0.3770 (Linux 0.0.0)]: Connected on socket rqiLiPHT0agj9DAVAAAA with id 38901236
05 06 2019 18:13:01.425:WARN [HeadlessChrome 75.0.3770 (Linux 0.0.0)]: Disconnected (1 times)
HeadlessChrome 75.0.3770 (Linux 0.0.0) ERROR
  Disconnectedundefined

Environment Details

  • Karma version (output of karma --version):
    [email protected]
  • Relevant part of your karma.config.js file
const PATHS = {
  specs: specHelperPath,
  fixtures: fixturesDir + '*.json'
};

module.exports = {
  customLaunchers: {
    chrome_no_sandbox: {
      base: 'ChromeHeadless',
      flags: ['--no-sandbox']
    }
  },
  frameworks: ['jasmine'],
  files: [
    PATHS.specs,
    PATHS.fixtures
  ],
  autoWatch: true,
  // The console output format
  browserNoActivityTimeout: 100000,
  browserDisconnectTolerance: 5,
  retryLimit: 5,
  webpack: webpack,
  webpackServer: {
    noInfo: true,
    stats: 'errors-only'
  },
  jsonFixturesPreprocessor: {
    stripPrefix: fixturesDir,
    variableName: '__json__'
  }
};
@josh08h
Copy link
Author

josh08h commented Jun 6, 2019

As you can see, karma-chrome-launcher has picked up the correct Chrome since the Karma logs show HeadlessChrome 75.0.3770

@johnjbarton
Copy link
Contributor

There seems to be some extra magic to get docker to work but we don't use docker and I don't know the incantations.

@t-gebauer
Copy link

We are having a very similar problem. I updated our docker image yesterday (which updated chrome 74 -> 75).
Karma v4.1.0
I could also reproduce the problem with chrome 76. No problems with chrome 74.
While trying all kinds of chrome flags the tests actually succeeded once or twice. But merely by accident and unreproducible.
Once in a while, half of our tests run before the browser disconnects.

@josh08h Which version of jasmine are you using?

@josh08h
Copy link
Author

josh08h commented Jun 7, 2019

@t-gebauer Chrome 74 works for us too. We install the latest stable which is now picking up 75.

As for jasmine version, we are using 2.99.0. I've played around with the flags passed through to Chrome but still have not managed to get a successful run of tests.

@josh08h josh08h changed the title Google Chrome 75.0.3770.80 HEADLESS connecting but not running tests. Google Chrome 75.0.3770.80 HEADLESS connecting but not running tests inside Docker. Jun 7, 2019
@t-gebauer
Copy link

With --single-process I am able to run exactly 622 of 1223 tests before the browser disconnects.

base : 'ChromeHeadless',
flags: [
  '--no-sandbox',
  '--single-process'
]

But reconnecting never works, timeout is irrelevant.

07 06 2019 13:17:46.992:DEBUG [HeadlessChrome 76.0.3806 (Linux 0.0.0)]: Disconnected during run, waiting 1000000ms for reconnecting.
07 06 2019 13:17:46.992:DEBUG [HeadlessChrome 76.0.3806 (Linux 0.0.0)]: EXECUTING -> EXECUTING_DISCONNECTED

@t-gebauer
Copy link

While I certainly did not fix the root problem, I could reduce the chance of disconnection and make HeadlessChrome 75.0.3770 a viable test browser in our environment.

  1. Remove karma-parallel
    Karma-parallel did already cause some unpleasant behavior with earlier versions of Chrome. But when the browser disconnects it prevents any recovery: The first tests that are actually run return 1 of 1 SUCCESS. This makes browserDisconnectTolerance useless in combination with karma-parallel.

  2. Add --single-process
    This seems to have a major impact on how often disconnects happen. While in my local environment the test do also run without --single-process, I don't think they ever do on our build server.

  3. Change log level to DEBUG
    For some reason using logLevel: config.LOG_INFO or higher (WARN, ERROR) causes a disconnection exactly after 622 of our 1223 tests.

@mramato
Copy link
Contributor

mramato commented Jun 19, 2019

I've ran into this as well. Our Docker/karma configuration worked great with Chrome 74 headless but karma no longer works with Chrome 75.

Is this even the correct place to discuss this or should an issue be written in the karma-chrome-launcher repository?

@johnjbarton
Copy link
Contributor

Yes this is for karma-chrome-launcher, but some needs to step up and investigate (we don't use karma-chrome-launcher).

@mramato
Copy link
Contributor

mramato commented Jun 20, 2019

Submitted karma-runner/karma-chrome-launcher#198

@zps938
Copy link

zps938 commented Jul 25, 2019

Using the --disable-dev-shm-usage flag fixed this for me.

@charleszardo
Copy link

Using --disable-dev-shm-usage also fixed the problem for me. Thanks @zps938

@devoto13
Copy link
Collaborator

[email protected] sets --disable-dev-shm-usage, so this should be resolved now. If you still experience the problem, please continue discussion in karma-runner/karma-chrome-launcher#198 as the issue is with the particular launcher.

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

7 participants