karma-runner / karma-chrome-launcher

A Karma plugin. Launcher for Chrome and Chrome Canary.
MIT License
469 stars 119 forks source link

Chromium crashing with karma supplied --user-data-dir #188

Open Lalem001 opened 6 years ago

Lalem001 commented 6 years ago

Expected behaviour

Chromium should run forever, until karma exits.

Actual behaviour

Chromium is crashing approximately 30 seconds after starting.

Chromium crash log shown in Karma's log:

Received signal 11 SEGV_MAPERR 000000000000
 [0x0001127796fc]
 [0x000112779611]
 [0x7fff7a65cf5a]
 [0x7fb21105e238]
 [0x000113d94e45]
 [0x000113d95206]
 [0x000113d99791]
 [0x0001126c5d82]
 [0x0001127410be]
 [0x000112782ff4]
 [0x0001127408f4]
 [0x0001127387af]
 [0x000112738514]
 [0x0001127834c7]
 [0x7fff7a666661]
 [0x7fff7a66650d]
 [0x7fff7a665bf9]
[end of stack trace]

Environment Details

const puppeteer = require('puppeteer');
process.env.CHROME_BIN = puppeteer.executablePath();
module.exports = function(config) {
  config.set({
    frameworks: ['jasmine'],
    files: ['app/**/*.spec.js'],
    reporters: ['progress'],
    port: 9876,
    colors: false,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['ChromeHeadless'],
    singleRun: false,
    concurrency: Infinity
  })
}

Steps to reproduce the behaviour

  1. $(npm bin)/karma start
  2. Observe crash at around the 30 second mark
  3. [Optional] Manually run chromium with the same args that karma uses, but with --user-data-dir either removed or pointing to an empty directory. No crash, tests pass fine.

While 3 is optional, please note the implication of 3.

sinedied commented 5 years ago

Tried with:

    customLaunchers: {
      ChromeHeadless_WithoutCrashing: {
        base: 'ChromeHeadless',
        chromeDataDir: path.resolve(__dirname, '.chrome-karma')
      }
    }

To replicate point 3) with an empty dir, still crashing for me :/ any workaround?

sinedied commented 5 years ago

FWIW I had this issue using a Chrome binary provided by the puppeteer package, but after upgrading to the latest version it's gone completely, so it might not be directly related to karma-chrome-launcher after all.