karma-runner / karma-runner/karma

Karma fails to restart phantomjs after crash

Open
#2,152 5 comments 1 reaction 0 assignees View on GitHub
needs: investigation
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Expected behavior

I expect karma to be able to restart phantomjs, as it tries to, whenever phantomjs crashes(which is commonplace).
### Actual behavior

After a PhantomJs crash, karma tries and fails to restart it two times. Consider this log:

```
PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 461 of 1279 (50 FAILED) (skipped 8) (0 secs / 10.394 secs)
PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 462 of 1279 (50 FAILED) (skipped 8) (0 secs / 10.409 secs)
PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 463 of 1279 (50 FAILED) (skipped 8) (0 secs / 10.424 secs)
27 05 2016 09:48:51.138:ERROR [launcher]: PhantomJS crashed.

27 05 2016 09:48:51.146:INFO [launcher]: Trying to start PhantomJS again (1/2).
27 05 2016 09:48:57.147:WARN [launcher]: PhantomJS have not captured in 6000 ms, killing.
27 05 2016 09:48:57.164:INFO [launcher]: Trying to start PhantomJS again (2/2).
27 05 2016 09:49:03.165:WARN [launcher]: PhantomJS have not captured in 6000 ms, killing.
27 05 2016 09:49:03.188:ERROR [launcher]: PhantomJS failed 2 times (timeout). Giving up.
```
### Enviroment Details

Windows 7 SP1 64bits Intel Core i7 16Gb

package.json 's depencies

``` json
{
"karma": "^0.13.21",
"karma-babel-preprocessor": "~6.0.1",
"karma-chai-plugins": "^0.7.0",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^0.5.3",
"karma-htmlfile-reporter": "^0.2.2",
"karma-jasmine": "^0.3.6",
"karma-junit-reporter": "^0.3.8",
"karma-ng-html2js-preprocessor": "^0.2.0",
"karma-phantomjs-launcher": "^0.2.1",
"karma-phantomjs-shim": "^1.1.2"
}
```

```
$ ./node_modules/karma/bin/karma --version
Karma version: 0.13.22
```

PhantomJS version: 1.9.20
- Relevant part of your `karma.config.js` file

```
{
// web server port
port: 3030,
// runner port
runnerPort: 3031,

captureTimeout: 6000,

plugins: [
'karma-chai-plugins',
'karma-coverage',
'karma-htmlfile-reporter',
'karma-jasmine',
'karma-junit-reporter',
'karma-ng-html2js-preprocessor',
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-phantomjs-shim'
],

/// [...]
}
```
### Notes

Running the tests with chrome works.
I've seen others bugs with PhantomJs capture timeouts, but here the thing is that it succeeds at first, but then fails on retries. So the configuration must be right

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.