karma-runner / karma-phantomjs-launcher

A Karma plugin. Launcher for PhantomJS.
MIT License
281 stars 131 forks source link

Phantomjs crashed #166

Open leizz opened 7 years ago

leizz commented 7 years ago

Hi there, I am running the testing for grafana which runs a grunt-karma testing task. And I got following error which relates to the karma-phantomjs-launcher. Does anyone have any ideas? Thanks.

Running "karma:test" (karma) task
[D] Task source: /root/gopath/src/github.com/grafana/grafana/node_modules/grunt-karma/tasks/grunt-karma.js
Verifying property karma.test exists in config...OK
File: [no files]
Options: background=false, client={}
06 03 2017 14:46:02.145:DEBUG [config]: autoWatch set to false, because of singleRun
06 03 2017 14:46:02.147:DEBUG [plugin]: Loading karma-* from /root/gopath/src/github.com/grafana/grafana/node_modules
06 03 2017 14:46:02.148:DEBUG [plugin]: Loading plugin /root/gopath/src/github.com/grafana/grafana/node_modules/karma-chrome-launcher.
06 03 2017 14:46:02.153:DEBUG [plugin]: Loading plugin /root/gopath/src/github.com/grafana/grafana/node_modules/karma-coverage.
06 03 2017 14:46:02.258:DEBUG [plugin]: Loading plugin /root/gopath/src/github.com/grafana/grafana/node_modules/karma-coveralls.
06 03 2017 14:46:02.363:DEBUG [plugin]: Loading plugin /root/gopath/src/github.com/grafana/grafana/node_modules/karma-expect.
06 03 2017 14:46:02.364:DEBUG [plugin]: Loading plugin /root/gopath/src/github.com/grafana/grafana/node_modules/karma-mocha.
06 03 2017 14:46:02.364:DEBUG [plugin]: Loading plugin /root/gopath/src/github.com/grafana/grafana/node_modules/karma-phantomjs-launcher.
06 03 2017 14:46:02.367:DEBUG [plugin]: Loading plugin /root/gopath/src/github.com/grafana/grafana/node_modules/karma-sinon.
06 03 2017 14:46:02.375:DEBUG [web-server]: Instantiating middleware
06 03 2017 14:46:02.805:INFO [karma]: Karma v1.3.0 server started at http://localhost:9876/
06 03 2017 14:46:02.805:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
06 03 2017 14:46:02.809:INFO [launcher]: Starting browser PhantomJS
06 03 2017 14:46:02.809:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-79976567
06 03 2017 14:46:02.811:DEBUG [launcher]: /usr/bin/phantomjs /tmp/karma-79976567/capture.js
06 03 2017 14:46:02.905:DEBUG [web-server]: serving: /root/gopath/src/github.com/grafana/grafana/node_modules/karma/static/client.html
06 03 2017 14:46:02.913:DEBUG [web-server]: serving: /root/gopath/src/github.com/grafana/grafana/node_modules/karma/static/karma.js
06 03 2017 14:46:02.917:ERROR [phantomjs.launcher]: PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.

06 03 2017 14:46:03.017:DEBUG [launcher]: Process PhantomJS exited with code 0
06 03 2017 14:46:03.017:ERROR [launcher]: Cannot start PhantomJS

06 03 2017 14:46:03.017:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-79976567
06 03 2017 14:46:03.020:INFO [launcher]: Trying to start PhantomJS again (1/2).
06 03 2017 14:46:03.020:DEBUG [launcher]: Restarting PhantomJS
06 03 2017 14:46:03.021:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-79976567
06 03 2017 14:46:03.021:DEBUG [launcher]: /usr/bin/phantomjs /tmp/karma-79976567/capture.js /tmp/karma-79976567/capture.js
06 03 2017 14:46:03.092:DEBUG [web-server]: serving (cached): /root/gopath/src/github.com/grafana/grafana/node_modules/karma/static/client.html
06 03 2017 14:46:03.098:DEBUG [web-server]: serving (cached): /root/gopath/src/github.com/grafana/grafana/node_modules/karma/static/karma.js
06 03 2017 14:46:03.103:ERROR [phantomjs.launcher]: PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.

06 03 2017 14:46:03.197:DEBUG [launcher]: Process PhantomJS exited with code 0
06 03 2017 14:46:03.197:ERROR [launcher]: Cannot start PhantomJS

06 03 2017 14:46:03.197:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-79976567
06 03 2017 14:46:03.197:INFO [launcher]: Trying to start PhantomJS again (2/2).
06 03 2017 14:46:03.197:DEBUG [launcher]: Restarting PhantomJS
06 03 2017 14:46:03.197:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-79976567
06 03 2017 14:46:03.198:DEBUG [launcher]: /usr/bin/phantomjs /tmp/karma-79976567/capture.js /tmp/karma-79976567/capture.js /tmp/karma-79976567/capture.js
06 03 2017 14:46:03.268:DEBUG [web-server]: serving (cached): /root/gopath/src/github.com/grafana/grafana/node_modules/karma/static/client.html
06 03 2017 14:46:03.273:DEBUG [web-server]: serving (cached): /root/gopath/src/github.com/grafana/grafana/node_modules/karma/static/karma.js
06 03 2017 14:46:03.279:ERROR [phantomjs.launcher]: PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> and file a bug report.

06 03 2017 14:46:03.375:DEBUG [launcher]: Process PhantomJS exited with code 0
06 03 2017 14:46:03.375:ERROR [launcher]: Cannot start PhantomJS

06 03 2017 14:46:03.375:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-79976567
06 03 2017 14:46:03.376:ERROR [launcher]: PhantomJS failed 2 times (cannot start). Giving up.
06 03 2017 14:46:03.377:DEBUG [karma]: Run complete, exiting.
06 03 2017 14:46:03.377:DEBUG [launcher]: Disconnecting all browsers
>> [grunt-notify] growl: Growl not available for your OS.
>> [grunt-notify] IS_WINDOWS: false
>> [grunt-notify] PROGRAM_FILES: undefined
>> [grunt-notify] PROGRAM_FILES_X86: undefined
>> [grunt-notify] fullPathToApplication: false
>> [grunt-notify] snarl: Snarl not available for this OS.
>> [grunt-notify] os: Linux
>> [grunt-notify] version: 4.4.0-47-generic
>> [grunt-notify] IS_MAC: false
>> [grunt-notify] MOUNTAIN_LION: false
>> [grunt-notify] notification_center: Not available for your OS.
>> [grunt-notify] notify-send: notify-send was not found in your path
>> [grunt-notify] os: Linux
>> [grunt-notify] version: 4.4.0-47-generic
>> [grunt-notify] IS_WINDOWS: false
>> [grunt-notify] WINDOWS_8: false
>> [grunt-notify] toaster: Not available for your OS.
>> [no-notifications] title: grafana
>> [no-notifications] message: Task "karma:test" failed.
Warning: Task "karma:test" failed. Use --force to continue.

Aborted due to warnings.
jurrinus commented 7 years ago

Check node_module phantom/lib and be sure location.js exists. If not do an NPR run install from the phantom folder to create it.

This works for both phantomjs and phantomjs-prebuilt

levivic commented 7 years ago

Thanks @jurrinus, location.js does exist in node_modeule/phantomjs-prebuilt/lib. Btw, I have installed phantomjs globally.