ChromeHeadless 79.0.3945 disconnected on jenkins
See original GitHub issueHi, 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:
[32m20 01 2020 13:54:20.183:INFO [karma-server]: [39mKarma v4.4.1 server started at http://0.0.0.0:8080/
13:54:21 [32m20 01 2020 13:54:20.191:INFO [launcher]: [39mLaunching browsers ChromeHeadless with concurrency unlimited
13:54:21 [32m20 01 2020 13:54:20.198:INFO [launcher]: [39mStarting browser Chrome
13:54:59 [32m20 01 2020 13:54:58.982:INFO [HeadlessChrome 79.0.3945 (Linux 0.0.0)]: [39mConnected on socket XnNj1UhzUvpfZH5iAAAA with id 88283591
13:55:32 [33m20 01 2020 13:55:31.108:WARN [HeadlessChrome 79.0.3945 (Linux 0.0.0)]: [39mDisconnected (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:
- Created 4 years ago
- Reactions:3
- Comments:7 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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
My tests is running with inline sourcemaps, will change them over and report back results…
EDIT Changing my
devtool
config frominline-source-map
tosource-map
ornone
doesn’t appear to solve the problem for me.