karma-runner/karma-chrome-launcher

Karma fails to capture Chrome v93 (but OK with Chrome Headless)

craigfowler opened this issue · 1 comments

Not so much a Karma bug but an issue I imagine others will search for. I figure it's worth reporting it here so that others may find both the problem and workaround together. I have also posted this on StackOverflow with further detail.

I have recently found that following an auto-update to Chrome v93 on our CI build agents, Karma has begun failing to capture Chrome and eventually gives up. In our karma.conf.js file, we were previously using browsers: ['Chrome'].

We have worked around this (and our builds succeed again) by switching to browsers: ['ChromeHeadless'] in our Karma config.

There might also be some kind of issue with Chrome itself which needs fixing, but for those who can manage with ChromeHeadless instead of full Chrome, the workaround should get things going again.

Actually we started to explore the same issue and the thing that helped was to start use of custom launcher with couple of flags.

Before our karma.conf.js contained the following settings:

module.exports = function (config) {
    config.set({
       ...
       browsers: ['Chrome'],
       ...
       customLaunchers: {
            ChromeHeadlessNoSandbox: {
                base: 'ChromeHeadless',
                flags: ['--no-sandbox']
            }
        },
    });
}       

Now it contains the following changes and tests are started to run again:

module.exports = function (config) {
    config.set({
       ...
       browsers: ['ChromeNoSandbox'],
       ...
        customLaunchers: {
            ChromeNoSandbox: {
                base: 'Chrome',
                flags: [
                    '--no-sandbox',
                ]
            }
        },
    });
}       

P.S.
Added the same comment on StackOverflow