can someone help me in this issue?
I am getting the '[launcher]: ChromeHeadless have not captured in 60000 ms, killing.' when the pipeline (Jenkins) is trying to exec the tests with karma (Puppeteer using ChromeHeadless)
We have as demmand of the client to change the launcher from Phantomjs to ChromeHeadless;
We've tried a lot of things and nothing works until now and i have no idea how to solve it.
some informations about the project configurations:
We use angular 7, karma dependencies and puppeteer as follow :
package.json
{
"name": "xxxxxxxx",
"version": "0.0.0",
"license": "my",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test -c karma.conf.js -cc --browsers MyChromeHeadless",
"lint": "ng lint",
"e2e": "ng e2e"
},
"dependencies": {
"@angular-devkit/build-angular": "^0.13.9",
"@angular/animations": "7.2.15",
"@angular/common": "7.2.15",
"@angular/compiler": "7.2.15",
"@angular/core": "7.2.15",
"@angular/forms": "7.2.15",
"@angular/http": "7.2.15",
"@angular/platform-browser": "7.2.15",
"@angular/platform-browser-dynamic": "7.2.15",
"@angular/router": "7.2.15",
"@ng-bootstrap/ng-bootstrap": "1.0.0-beta.4",
"@ngx-translate/core": "^8.0.0",
"angl-spawebbgrl": "^6.2.0",
"angular2-text-mask": "^8.0.4",
"angular2-tinymce": "2.1.2",
"angular2-ui-switch": "^1.2.0",
"bootstrap": "^3.3.7",
"core-js": "2.4.1",
"font-awesome": "^4.7.0",
"intl": "^1.2.5",
"jquery": "^3.4.1",
"moment": "^2.24.0",
"ng2-bs3-modal": "^0.10.4",
"ng2-translate": "^5.0.0",
"ngx-bootstrap": "1.9.3",
"ngx-toastr": "^6.5.0",
"puppeteer": "^2.0.0",
"rxjs": "6.5.3",
"rxjs-compat": "^6.0.0-rc.0",
"text-mask-addons": "^3.7.0",
"tslib": "^1.9.0",
"xlsx": "^0.12.0",
"zone.js": "0.8.29"
},
"devDependencies": {
"@angular/cli": "^7.3.9",
"@angular/compiler-cli": "^7.2.15",
"@angular/language-service": "^7.2.15",
"@types/jasmine": "3.4.6",
"@types/jasminewd2": "2.0.8",
"@types/node": "8.10.59",
"bower-art-resolver": "^2.0.10",
"chai": "4.2.0",
"codelyzer": "3.0.1",
"jasmine-core": "3.5.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "^4.4.1",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.1.0",
"karma-cli": "2.0.0",
"karma-coverage": "^2.0.1",
"karma-coverage-istanbul-reporter": "2.1.0",
"karma-jasmine": "2.0.1",
"karma-jasmine-html-reporter": "1.4.2",
"karma-junit-reporter": "2.0.1",
"karma-mocha": "^1.1.1",
"karma-sinon": "1.0.5",
"mocha": "^6.2.2",
"mocha-junit-reporter": "1.23.1",
"protractor": "^6.0.0",
"selenium-webdriver": "^3.6.0",
"sinon": "1.17.5",
"ts-node": "3.0.4",
"tslint": "5.3.2",
"typescript": "^3.1.1"
},
"optionalDependencies": {
}
}
Our karma configuration:
karma.conf.js
module.exports = function (config) {
const process = require('process');
process.env.CHROME_BIN = require('puppeteer').executablePath();
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-coverage'),
require('karma-coverage-istanbul-reporter'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
files:[
'src/test.ts'
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true,
dir: 'coverage',
'report-config': { html: { subdir: 'html'} }
},
reporters: ['progress', 'kjhtml', 'coverage'],
port: 9876,
logLevel: config.LOG_DEBUG,
autoWatch: false,
singleRun: true,
browsers: ['MyChromeHeadless'],
customLaunchers: {
MyChromeHeadless: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox',
'--proxy-auto-detect'
]
}
}
});
};
This error occurs when jenkins try to exec the tests, but locally runs everything ok. This problem is specific of the pipeline that is running over a linux machine;
Has someone to help me to get '[launcher]: ChromeHeadless have not captured in 60000 ms, killing.' fixed?
Any advice will be welcome. Tkx!