karma-runner / karma-runner/karma

[object CustomEvent] thrown randomly/intermittently for any of tests in angular2 test suite

Open
#2,888 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Expected behaviour
Tests should not fail intermittently without any logic issue.

### Actual behaviour

### Environment Details
Running tests on PhantomJS browser.

- Karma version (output of `karma --version`): 1.7.0
- Relevant part of your `karma.config.js` file

```
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma'),
require('karma-junit-reporter'),
require('karma-phantomjs-launcher')
],
client:{
clearContext: false
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true,
thresholds: {
statements: 40,
lines: 40,
branches: 40,
functions: 30
}
},
angularCli: {
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress','coverage-istanbul','kjhtml', 'dots', 'junit']
: ['progress', 'kjhtml', 'dots', 'junit'],
junitReporter: {
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['PhantomJS'],
singleRun: true
});
};
```

### Steps to reproduce the behaviour

1. Run a angular2 test suite with more than 50 tests in it.
2. Randomly few of tests fails with error message as '[object CustomEvent] thrown'; No further error information is present.
3.

Contributor guide

Open the contributing guide

Research direction

Start with the provided karma.config.js and reproduce the failure by running the Angular test suite in PhantomJS with more than 50 tests. Investigate why intermittent failures surface only as '[object CustomEvent] thrown'; done means the tests run reliably and failures provide actionable error information.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, javascript
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.