karma-runner / karma-runner/karma
Karma takes approx. two minutes to start
- Dominant language
- JavaScript
- Stars
- 12k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
When running the tests. It takes about two minutes for karma to start. After that, all the tests run smoothly. I'm only using a couple of plugins and I tried disabling them with the same result.
I don't consider this an issue of `ChromeHeadless` since I was using `PhantomJS` previously with the same result. Our test suite is ~400 tests.

### Expected behaviour
Karma should start faster.
### Actual behaviour
Karma takes about two minutes to start.
### Environment Details
- Karma version 1.3.0
- OS: Windows 7
- Browser: ChromeHeadless
- Karma.config:
```
let webpack = require('webpack');
process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = function(config) {
config.set({
frameworks: ['jasmine'],
files: [
'test/**/*-spec.js',
],
plugins: [
'karma-webpack',
'karma-jasmine',
'karma-sourcemap-loader',
'karma-spec-reporter',
'karma-coverage-istanbul-reporter',
'karma-chrome-launcher'
],
reporters: [
'spec',
'coverage-istanbul'
],
coverageIstanbulReporter: {
reports: ['html', 'text'],
thresholds: {
statements: 100,
lines: 100,
branches: 100,
functions: 100
}
},
port: 9876,
colors: true,
logLevel: config.LOG_DEBUG,
autoWatch: false,
singleRun: true,
browsers: ['ChromeHeadless']
});
};
```
### Steps to reproduce the behaviour
1. `yarn run test`
Contributor guide
Research direction
Start with the Karma configuration shown in the issue and run `yarn run test` with `logLevel: config.LOG_DEBUG` on the reported Windows 7 and ChromeHeadless setup. Trace where the roughly two-minute startup occurs across the listed frameworks, plugins, reporters, and browser launch; done means identifying and reducing the startup delay while keeping the test suite running successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- performance, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100