question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ChromeHeadless 79.0.3945 disconnected on jenkins

See original GitHub issue

Hi, I have a problem with executing unit tests on jenkins.

Dependencies:

"@angular-devkit/build-angular": "^0.803.23",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.4.1",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.1",
"karma-jasmine": "~3.1.0",
"karma-jasmine-html-reporter": "^1.5.1",
"puppeteer": "^2.0.0",

My karma’s configuration is:

const process = require('process');
process.env.CHROME_BIN = require('puppeteer').executablePath();

module.exports = function (config) {
  config.set({
    basePath: '',
    browserNoActivityTimeout: 50000,
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-jasmine-html-reporter'),
      require('karma-coverage-istanbul-reporter'),
      require('@angular-devkit/build-angular/plugins/karma')
    ],
    client:{
      clearContext: false // leave Jasmine Spec Runner output visible in browser
    },
    coverageIstanbulReporter: {
      reports: [ 'html', 'lcovonly' ],
      fixWebpackSourcePaths: true
    },
    angularCli: {
      environment: 'dev'
    },
    reporters: ['progress', 'kjhtml'],
    port: 8080,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['ChromeHeadless'],
    singleRun: true,
    customLaunchers: {
      ChromeHeadless: {
        base: 'Chrome',
        flags: [
          '--headless',
          '--disable-gpu',
          '--remote-debugging-port=9222',
          '--no-sandbox',
          '--disable-dev-shm-usage'
        ]
      }
    }
  });
};

Error messages:

20 01 2020 13:54:20.183:INFO [karma-server]: Karma v4.4.1 server started at http://0.0.0.0:8080/
13:54:21 20 01 2020 13:54:20.191:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited
13:54:21 20 01 2020 13:54:20.198:INFO [launcher]: Starting browser Chrome
13:54:59 20 01 2020 13:54:58.982:INFO [HeadlessChrome 79.0.3945 (Linux 0.0.0)]: Connected on socket XnNj1UhzUvpfZH5iAAAA with id 88283591
13:55:32 20 01 2020 13:55:31.108:WARN [HeadlessChrome 79.0.3945 (Linux 0.0.0)]: Disconnected (0 times)reconnect failed before timeout of 2000ms (ping timeout)
13:55:32 HeadlessChrome 79.0.3945 (Linux 0.0.0) ERROR
13:55:32   Disconnectedreconnect failed before timeout of 2000ms (ping timeout)
13:55:32 
13:55:32 HeadlessChrome 79.0.3945 (Linux 0.0.0) ERROR
13:55:32   Disconnectedreconnect failed before timeout of 2000ms (ping timeout)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
breautekcommented, Jan 28, 2020

For me, I’ve discovered the disconnect issue was actually due to flawed logic in my code base, where there was a memory leak of event listeners.

After karma disconnected from chrome, we noticed chrome was still going full throttle eating up 100% of the CPU, which led us to start commenting out unit tests until the problem went away. Eventually this led us to isolate the problem to one group of unit tests and eventually to a specific class in our code base.

Hope this helps some one.

0reactions
breautekcommented, Jan 28, 2020

It’s not limited to jenkins, seeing this error, just on my dev machine running Ubuntu 18, and my college using Mac OS X Catalina.

It happens very frequently, but sometimes all tests will run without disconnects for me. We’ve been run tests very often, so I’m fairly confident the issue only appears as of Chrome 79.0.3945

"karma": "4.4.1",
"karma-chrome-launcher": "3.1.0",

We started converting sourcemaps from inline to URL refs about six months ago because of browser failures on large test code.

My tests is running with inline sourcemaps, will change them over and report back results…

EDIT Changing my devtool config from inline-source-map to source-map or none doesn’t appear to solve the problem for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Karma Chrome Headless not working on Jenkins
There was a connection that was disconnecting too soon. He found that in /static/karma.js, when the socket was created, there was a timeout ......
Read more >
CHROME HEADLESS ON JENKINS. In an earlier ... - Medium
Here we will run these tests inside Jenkins using Chrome Headless. Jenkins build. First we update our Jenkins pipeline library to run tests....
Read more >
运行chrome 无头selenium-java - 免费编程教程
ChromeHeadless 79.0.3945 在jenkins 上断开连接· 问题#218Chrome 58.0.3029 (Linux ... Chrome 58.0.3029 (Linux 0.0.0): Executed 0 of 0 DISCONNECTED (10.004 secs ...
Read more >
Getting an error when I run my test via Jenkins and Chrome ...
I run my tests via Jenkins using Chrome (headless) and incognito mode. With Chrome 72.0.3626.121 tests execute without problems, ...
Read more >
Karma test with ChromeHeadless '--no-sandbox' issue
I'm trying to run Karma tests in Jenkins pipeline. I'm new to this topic, and to start, I pulled openui5-sample-app from Git repository....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found