karma-runner/karma-chrome-launcher

Headless Firefox with Karma-Parallel

D00tWhile opened this issue · 1 comments

Currently, I run Karma in parallel on Firefox.
However, I am trying to make this process headless with Firefox using xvfb-run.

Is this even possible?

Error start:
17 07 2019 14:13:59.285:INFO [launcher]: Starting browser Firefox
 19% building modules 76/76 modules 0 active17 07 2019 14:13:59.777:ERROR [launcher]: Cannot start Firefox
	ExceptionHandler::GenerateDump cloned child 24068
ExceptionHandler::SendContinueSignalToChild sent continue signal to child
ExceptionHandler::WaitForContinueSignal waiting for continue signal...

Error end:
17 07 2019 14:14:05.671:ERROR [launcher]: Firefox stdout: 
17 07 2019 14:14:05.671:ERROR [launcher]: Firefox stderr: ExceptionHandler::GenerateDump cloned child 24198
ExceptionHandler::SendContinueSignalToChild sent continue signal to child
ExceptionHandler::WaitForContinueSignal waiting for continue signal...

 70% building modules 613/613 modules 0 active17 07 2019 14:14:06.717:ERROR [launcher]: Firefox failed 2 times (cannot start). Giving up.

karma.config:

module.exports = function (config) {
  config.set({
    basePath: '',
    // NOTE: 'parallel' must be the first framework in the list
    frameworks: ['parallel', 'jasmine', '@angular-devkit/build-angular'],
    plugins: [
      require('karma-jasmine'),
      require('karma-firefox-launcher'),
      require('karma-chrome-launcher'),
      require('karma-jasmine-html-reporter'),
      require('karma-coverage-istanbul-reporter'),
      require('@angular-devkit/build-angular/plugins/karma'),
      require('karma-parallel')   
    ],
    parallelOptions: {
      executors: Math.ceil(require('os').cpus().length / 2),
      shardStrategy: 'round-robin'
    },
    client:{
      clearContext: false, // leave Jasmine Spec Runner output visible in browser
      jasmine: {
        timeoutInterval: 10000 // Set the Jasmine default timeout interval.
      }
    },
    coverageIstanbulReporter: {
      dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
      fixWebpackSourcePaths: true
    },
    angularCli: {
      environment: 'dev'
    },
    reporters: ['progress', 'kjhtml'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Firefox'],
    singleRun: false,
    concurrency: Infinity
  });
};

It's hard to say what could be possibly going wrong here, but I think you would be better off using headless firefox instead of running it in a virtual x server environment.

https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode

Anyway, this is unrelated with karma-chrome-launcher so I'm closing it.