Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhantomJS doesn't feel well (You need to include some adapter that implements karma.start method!) #1545

Closed
albertosantini opened this issue Aug 5, 2015 · 31 comments · May be fixed by Omrisnyk/npm-lockfiles#122 or Omrisnyk/npm-lockfiles#132
Assignees

Comments

@albertosantini
Copy link

On Travis CI with 0.13.6 I get with Node.js (with io.js it is ok) the following message:

You need to include some adapter that implements karma.start method!

Locally it is ok.

Reference:

P.S.: Locally on Windows 10 box.

@arty-name
Copy link

I get the same error locally, and so far I have figured out that it works with Chrome, but fails on headless phantomjs. Version 0.13.4 works fine.

@dignifiedquire
Copy link
Member

@arty-name what node version are you running, and what phantomjs-launcher and phantomjs version?

@arty-name
Copy link

@dignifiedquire,
Ubuntu 15.04 x64
node --version
v0.12.7
"karma-phantomjs-launcher": "0.2.0"
"phantomjs": "1.9.17"

@dignifiedquire dignifiedquire changed the title You need to include some adapter that implements karma.start method! PhantomJS doesn't feel well (You need to include some adapter that implements karma.start method!) Aug 5, 2015
@coderbyheart
Copy link

Same problem here (0.13.4 works):
Debian 8.1
node v0.12.7
karma-phantomjs-launcher@0.2.0
phantomjs@1.9.17

@dignifiedquire
Copy link
Member

Does anyone see this issue consistently, or just sometimes? Because on travis I was able to get rid of the issue after the fifth test run or so. (Which doesn't give me any more ideas as to what the actual problem is :( )

@coderbyheart @arty-name any public code I could look at?

@zbysiusiekiera
Copy link

It looks like I am facing similar problem. I am trying to setup Karma, Mocha, Chai and PhantomJS but I keep receiving this error:

jkochman@spaceship:~/Work/MTViewCenter2$ karma start
05 08 2015 14:57:28.688:DEBUG [plugin]: Loading karma-* from /home/jkochman/Work/MTViewCenter2/node_modules
05 08 2015 14:57:28.691:DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-chai.
05 08 2015 14:57:28.692:DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-chrome-launcher.
05 08 2015 14:57:28.696:DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-firefox-launcher.
05 08 2015 14:57:28.697:DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-mocha.
05 08 2015 14:57:28.698:DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-phantomjs-launcher.
05 08 2015 14:57:28.723:DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-requirejs.
05 08 2015 14:57:28.763:INFO [karma]: Karma v0.13.6 server started at http://localhost:9876/
05 08 2015 14:57:28.767:INFO [launcher]: Starting browser PhantomJS
05 08 2015 14:57:28.767:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-44042
05 08 2015 14:57:28.770:DEBUG [launcher]: /home/jkochman/Work/MTViewCenter2/node_modules/phantomjs/lib/phantom/bin/phantomjs /tmp/karma-44042/capture.js
05 08 2015 14:57:28.881:DEBUG [web-server]: serving: /home/jkochman/Work/MTViewCenter2/node_modules/karma/static/client.html
05 08 2015 14:57:28.895:DEBUG [web-server]: serving: /home/jkochman/Work/MTViewCenter2/node_modules/karma/static/karma.js
05 08 2015 14:57:28.925:DEBUG [karma]: A browser has connected on socket ESN93SgZ9uM3wcjNAAAA
05 08 2015 14:57:28.928:DEBUG [web-server]: upgrade /socket.io/?EIO=3&transport=websocket&sid=ESN93SgZ9uM3wcjNAAAA
05 08 2015 14:57:28.997:INFO [PhantomJS 1.9.8 (Linux 0.0.0)]: Connected on socket ESN93SgZ9uM3wcjNAAAA with id 44042
05 08 2015 14:57:28.998:DEBUG [launcher]: PhantomJS (id 44042) captured in 0.234 secs
05 08 2015 14:57:29.003:DEBUG [web-server]: serving: /home/jkochman/Work/MTViewCenter2/node_modules/karma/static/context.html
PhantomJS 1.9.8 (Linux 0.0.0) ERROR
  You need to include some adapter that implements __karma__.start method!
05 08 2015 14:57:29.050:DEBUG [karma]: Run complete, exiting.
05 08 2015 14:57:29.051:DEBUG [launcher]: Disconnecting all browsers
05 08 2015 14:57:29.061:DEBUG [launcher]: Process PhantomJS exited with code 0
05 08 2015 14:57:29.062:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-44042

If I add another browser like Chrome or Firefox it's running ok. I don't understand why there are two 'PhantomJS 1.9.8 (Linux 0.0.0): Executed 1 of 1 SUCCESS (0.041 secs / 0.001 secs)' lines though:

jkochman@spaceship:~/Work/MTViewCenter2$ karma start
05 08 2015 14:59:34.099:DEBUG [plugin]: Loading karma-* from /home/jkochman/Work/MTViewCenter2/node_modules
05 08 2015 14:59:34.102:DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-chai.
05 08 2015 14:59:34.103:DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-chrome-launcher.
05 08 2015 14:59:34.107:DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-firefox-launcher.
05 08 2015 14:59:34.108:DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-mocha.
05 08 2015 14:59:34.109:DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-phantomjs-launcher.
05 08 2015 14:59:34.134:DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-requirejs.
05 08 2015 14:59:34.171:INFO [karma]: Karma v0.13.6 server started at http://localhost:9876/
05 08 2015 14:59:34.175:INFO [launcher]: Starting browser Chrome
05 08 2015 14:59:34.175:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-55000399
05 08 2015 14:59:34.175:DEBUG [launcher]: google-chrome --user-data-dir=/tmp/karma-55000399 --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate http://localhost:9876/?id=55000399
05 08 2015 14:59:34.181:INFO [launcher]: Starting browser PhantomJS
05 08 2015 14:59:34.182:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-26205044
05 08 2015 14:59:34.185:DEBUG [launcher]: /home/jkochman/Work/MTViewCenter2/node_modules/phantomjs/lib/phantom/bin/phantomjs /tmp/karma-26205044/capture.js
05 08 2015 14:59:34.306:DEBUG [web-server]: serving: /home/jkochman/Work/MTViewCenter2/node_modules/karma/static/client.html
05 08 2015 14:59:34.319:DEBUG [web-server]: serving: /home/jkochman/Work/MTViewCenter2/node_modules/karma/static/karma.js
05 08 2015 14:59:34.357:DEBUG [karma]: A browser has connected on socket 3muEwILnWOTT9zTHAAAA
05 08 2015 14:59:34.373:DEBUG [web-server]: upgrade /socket.io/?EIO=3&transport=websocket&sid=3muEwILnWOTT9zTHAAAA
05 08 2015 14:59:34.434:INFO [PhantomJS 1.9.8 (Linux 0.0.0)]: Connected on socket 3muEwILnWOTT9zTHAAAA with id 26205044
05 08 2015 14:59:34.435:DEBUG [launcher]: PhantomJS (id 26205044) captured in 0.263 secs
05 08 2015 14:59:34.441:DEBUG [web-server]: serving: /home/jkochman/Work/MTViewCenter2/node_modules/karma/static/context.html
05 08 2015 14:59:34.444:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/chai/chai.js
05 08 2015 14:59:34.446:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/karma-chai/adapter.js
05 08 2015 14:59:34.448:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/mocha/mocha.js
05 08 2015 14:59:34.450:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/karma-mocha/lib/adapter.js
05 08 2015 14:59:34.450:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/test-main.js
05 08 2015 14:59:34.451:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/test/test.spec.js
PhantomJS 1.9.8 (Linux 0.0.0): Executed 1 of 1 SUCCESS (0.041 secs / 0.001 secs)
05 08 2015 14:59:34.529:DEBUG [launcher]: Process PhantomJS exited with code 0
05 08 2015 14:59:34.530:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-26205044
05 08 2015 14:59:35.038:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/karma/static/client.html
05 08 2015 14:59:35.048:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/karma/static/karma.js
05 08 2015 14:59:35.125:DEBUG [karma]: A browser has connected on socket zS6D9KPF8OZCBj2IAAAB
05 08 2015 14:59:35.135:DEBUG [web-server]: upgrade /socket.io/?EIO=3&transport=websocket&sid=zS6D9KPF8OZCBj2IAAAB
05 08 2015 14:59:35.147:DEBUG [web-server]: serving: /home/jkochman/Work/MTViewCenter2/node_modules/karma/static/favicon.ico
05 08 2015 14:59:35.150:INFO [Chrome 44.0.2403 (Linux 0.0.0)]: Connected on socket zS6D9KPF8OZCBj2IAAAB with id 55000399
05 08 2015 14:59:35.151:DEBUG [launcher]: Chrome (id 55000399) captured in 0.979 secs
05 08 2015 14:59:35.164:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/karma/static/context.html
05 08 2015 14:59:35.169:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/chai/chai.js
05 08 2015 14:59:35.171:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/karma-chai/adapter.js
05 08 2015 14:59:35.172:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/mocha/mocha.js
05 08 2015 14:59:35.177:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/karma-mocha/lib/adapter.js
05 08 2015 14:59:35.178:DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/test-main.js
PhantomJS 1.9.8 (Linux 0.0.0): Executed 1 of 1 SUCCESS (0.041 secs / 0.001 secs)
Chrome 44.0.2403 (Linux 0.0.0): Executed 1 of 1 SUCCESS (0.009 secs / 0.001 secs)
TOTAL: 2 SUCCESS
05 08 2015 14:59:35.229:DEBUG [karma]: Run complete, exiting.
05 08 2015 14:59:35.230:DEBUG [launcher]: Disconnecting all browsers
05 08 2015 14:59:35.797:DEBUG [launcher]: Process Chrome exited with code 0
05 08 2015 14:59:35.797:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-55000399

It also works if I downgrade Karma to 0.12.37 (tried 0.13.4):

jkochman@spaceship:~/Work/MTViewCenter2$ karma start
DEBUG [plugin]: Loading karma-* from /home/jkochman/Work/MTViewCenter2/node_modules
DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-chai.
DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-chrome-launcher.
DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-firefox-launcher.
DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-mocha.
DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-phantomjs-launcher.
DEBUG [plugin]: Loading plugin /home/jkochman/Work/MTViewCenter2/node_modules/karma-requirejs.
DEBUG [watcher]: Resolved files:
    /home/jkochman/Work/MTViewCenter2/node_modules/chai/chai.js
    /home/jkochman/Work/MTViewCenter2/node_modules/karma-chai/adapter.js
    /home/jkochman/Work/MTViewCenter2/node_modules/mocha/mocha.js
    /home/jkochman/Work/MTViewCenter2/node_modules/karma-mocha/lib/adapter.js
    /home/jkochman/Work/MTViewCenter2/test/test.spec.js
INFO [karma]: Karma v0.12.37 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
DEBUG [temp-dir]: Creating temp dir at /tmp/karma-84303543
DEBUG [launcher]: /home/jkochman/Work/MTViewCenter2/node_modules/phantomjs/lib/phantom/bin/phantomjs /tmp/karma-84303543/capture.js
DEBUG [web-server]: serving: /home/jkochman/Work/MTViewCenter2/node_modules/karma/static/client.html
DEBUG [web-server]: serving: /home/jkochman/Work/MTViewCenter2/node_modules/karma/static/karma.js
DEBUG [web-server]: upgrade /socket.io/1/websocket/1wdsyb1J3mcOT2vp9VqC
DEBUG [karma]: A browser has connected on socket 1wdsyb1J3mcOT2vp9VqC
INFO [PhantomJS 1.9.8 (Linux 0.0.0)]: Connected on socket 1wdsyb1J3mcOT2vp9VqC with id 84303543
DEBUG [launcher]: PhantomJS (id 84303543) captured in 0.378 secs
DEBUG [web-server]: serving: /home/jkochman/Work/MTViewCenter2/node_modules/karma/static/context.html
DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/chai/chai.js
DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/karma-chai/adapter.js
DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/mocha/mocha.js
DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/node_modules/karma-mocha/lib/adapter.js
DEBUG [web-server]: serving (cached): /home/jkochman/Work/MTViewCenter2/test/test.spec.js
PhantomJS 1.9.8 (Linux 0.0.0): Executed 1 of 1 SUCCESS (0.044 secs / 0.001 secs)
DEBUG [karma]: Run complete, exiting.
DEBUG [launcher]: Disconnecting all browsers
DEBUG [launcher]: Process PhantomJS exited with code 0
DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-84303543

Karma config:


// Karma configuration
// Generated on Wed Aug 05 2015 13:45:25 GMT+0200 (CEST)
module.exports = function(config) {
  config.set({
    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',
    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['mocha', 'chai'],
    // list of files / patterns to load in the browser
    files: [
      {pattern: 'test/**/*.spec.js', included: true}
    ],
    // list of files to exclude
    exclude: [
    ],
    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
    },
    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],
    // web server port
    port: 9876,
    // enable / disable colors in the output (reporters and logs)
    colors: true,
    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_DEBUG,
    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: false,
    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['PhantomJS'],
    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: true
  })
}

@kketch
Copy link

kketch commented Aug 5, 2015

Same issue here,
node: 0.12.7
karma: 0.13.6
karma-phantomjs-launcher: 0.2.0

Just noticed the issue, my test ran and eveything worked as expected the first time (singleRun: true, autoWatch: false). Then I ran them a second time and I couldn't get it to work again since. I get this error too:

 PhantomJS 1.9.8 (Linux 0.0.0) ERROR
 You need to include some adapter that implements __karma__.start method

However I didn't get the issue yet when i am using karma with (singleRun: false, autoWatch: true), does anyone have ?

@arty-name
Copy link

@dignifiedquire, I was getting this error quite reliably, but the code is not public, sorry

@dignifiedquire
Copy link
Member

Okay, I need some more details from you guys please, as I still can't reproduce this anywhere on my machines, could you please install the latest karma-phantomjs-launcher@0.2.1 and use the debugger as described here, set karma log level to debug and let me know what the output on the console, as well as in the opened debuger in the log is please.

@kketch
Copy link

kketch commented Aug 5, 2015

I'll try to debug using this asap. Also I'm using karma-mocha v0.1.10, maybe it's relevant ? I assume you don't ?

@dignifiedquire
Copy link
Member

No, but I just tried with karma-mocha@0.1.10 it was working fine with it for me

@arty-name
Copy link

So I have tried the debug configuration and as soon as I put debug: true in it starts working fine. I comment the debug: true out, and it fails again.

Config:

{
    logLevel: 'DEBUG',
    browsers: ['PhantomJS_custom'],
    customLaunchers: {
        'PhantomJS_custom': {
            base: 'PhantomJS',
            options: {
                windowName: 'my-window',
                settings: {
                    webSecurityEnabled: false
                }
            },
            flags: ['--load-images=true'],
            //debug: true
        }
    },

    phantomjsLauncher: {
        // Have phantomjs exit if a ResourceError is encountered (useful if karma exits without killing phantom)
        exitOnResourceError: true
    }
}

Log of failure:

05 08 2015 16:38:47.987:DEBUG [config]: autoWatch set to false, because of singleRun
05 08 2015 16:38:47.989:DEBUG [plugin]: Loading plugin karma-jasmine.
05 08 2015 16:38:47.990:DEBUG [plugin]: Loading plugin karma-coverage.
05 08 2015 16:38:48.007:DEBUG [plugin]: Loading plugin karma-phantomjs-launcher.
05 08 2015 16:38:48.027:DEBUG [plugin]: Loading plugin karma-chrome-launcher.
05 08 2015 16:38:48.031:DEBUG [plugin]: Loading plugin karma-firefox-launcher.
05 08 2015 16:38:48.032:DEBUG [plugin]: Loading plugin karma-safari-launcher.
05 08 2015 16:38:48.033:DEBUG [plugin]: Loading plugin karma-junit-reporter.
05 08 2015 16:38:48.036:DEBUG [plugin]: Loading plugin karma-html-reporter.
05 08 2015 16:38:48.046:DEBUG [plugin]: Loading plugin karma-spec-reporter.
05 08 2015 16:38:48.049:DEBUG [plugin]: Loading plugin karma-fixture.
05 08 2015 16:38:48.050:DEBUG [plugin]: Loading plugin karma-json-fixtures-preprocessor.
05 08 2015 16:38:48.051:DEBUG [plugin]: Loading inlined plugin (defining launcher:PhantomJS_custom).
05 08 2015 16:38:48.100:INFO [karma]: Karma v0.13.6 server started at http://localhost:9876/
05 08 2015 16:38:48.116:INFO [launcher]: Starting browser PhantomJS
05 08 2015 16:38:48.117:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-17726920
05 08 2015 16:38:48.119:DEBUG [launcher]: /home/treguben/dev/here.com/node_modules/phantomjs/lib/phantom/bin/phantomjs --load-images=true /tmp/karma-17726920/capture.js
05 08 2015 16:38:48.218:DEBUG [web-server]: serving: /home/treguben/dev/here.com/node_modules/karma/static/client.html
05 08 2015 16:38:48.226:DEBUG [web-server]: serving: /home/treguben/dev/here.com/node_modules/karma/static/karma.js
05 08 2015 16:38:48.245:DEBUG [karma]: A browser has connected on socket EIVNkwuOyie7GgKNAAAA
05 08 2015 16:38:48.248:DEBUG [web-server]: upgrade /socket.io/?EIO=3&transport=websocket&sid=EIVNkwuOyie7GgKNAAAA
05 08 2015 16:38:48.307:INFO [PhantomJS 1.9.8 (Linux 0.0.0)]: Connected on socket EIVNkwuOyie7GgKNAAAA with id 17726920
05 08 2015 16:38:48.308:DEBUG [launcher]: PhantomJS (id 17726920) captured in 0.208 secs
05 08 2015 16:38:48.312:DEBUG [web-server]: serving: /home/treguben/dev/here.com/node_modules/karma/static/context.html
PhantomJS 1.9.8 (Linux 0.0.0) ERROR
  You need to include some adapter that implements __karma__.start method!


05 08 2015 16:38:48.357:DEBUG [karma]: Run complete, exiting.
05 08 2015 16:38:48.357:DEBUG [launcher]: Disconnecting all browsers
05 08 2015 16:38:48.361:DEBUG [launcher]: Process PhantomJS exited with code 0
05 08 2015 16:38:48.361:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-17726920

@arty-name
Copy link

Log of successful fun in case you need it:

05 08 2015 16:38:20.750:DEBUG [config]: autoWatch set to false, because of singleRun
05 08 2015 16:38:20.753:DEBUG [plugin]: Loading plugin karma-jasmine.
05 08 2015 16:38:20.754:DEBUG [plugin]: Loading plugin karma-coverage.
05 08 2015 16:38:20.770:DEBUG [plugin]: Loading plugin karma-phantomjs-launcher.
05 08 2015 16:38:20.789:DEBUG [plugin]: Loading plugin karma-chrome-launcher.
05 08 2015 16:38:20.794:DEBUG [plugin]: Loading plugin karma-firefox-launcher.
05 08 2015 16:38:20.795:DEBUG [plugin]: Loading plugin karma-safari-launcher.
05 08 2015 16:38:20.796:DEBUG [plugin]: Loading plugin karma-junit-reporter.
05 08 2015 16:38:20.798:DEBUG [plugin]: Loading plugin karma-html-reporter.
05 08 2015 16:38:20.809:DEBUG [plugin]: Loading plugin karma-spec-reporter.
05 08 2015 16:38:20.811:DEBUG [plugin]: Loading plugin karma-fixture.
05 08 2015 16:38:20.813:DEBUG [plugin]: Loading plugin karma-json-fixtures-preprocessor.
05 08 2015 16:38:20.814:DEBUG [plugin]: Loading inlined plugin (defining launcher:PhantomJS_custom).
05 08 2015 16:38:20.862:INFO [karma]: Karma v0.13.6 server started at http://localhost:9876/
05 08 2015 16:38:20.878:INFO [launcher]: Starting browser PhantomJS
05 08 2015 16:38:20.878:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-80480871
05 08 2015 16:38:20.881:DEBUG [launcher]: /home/treguben/dev/here.com/node_modules/phantomjs/lib/phantom/bin/phantomjs --load-images=true --remote-debugger-port=9000 --remote-debugger-autorun=yes /tmp/karma-80480871/capture.js
05 08 2015 16:38:20.884:INFO [phantomjs.launcher]: ACTION REQUIRED:
05 08 2015 16:38:20.884:INFO [phantomjs.launcher]: 
05 08 2015 16:38:20.885:INFO [phantomjs.launcher]:   Launch browser at
05 08 2015 16:38:20.885:INFO [phantomjs.launcher]:   http://localhost:9000/webkit/inspector/inspector.html?page=2
05 08 2015 16:38:20.885:INFO [phantomjs.launcher]: 
05 08 2015 16:38:20.885:INFO [phantomjs.launcher]: Waiting 15 seconds ...
05 08 2015 16:38:20.974:DEBUG [phantomjs.launcher]: Launch the debugger page at http://localhost:9000/webkit/inspector/inspector.html?page=2
Waiting 15 seconds for debugger page to launch...

05 08 2015 16:38:35.986:DEBUG [phantomjs.launcher]: Launching page http://localhost:9876/?id=80480871...

05 08 2015 16:38:35.994:DEBUG [web-server]: serving: /home/treguben/dev/here.com/node_modules/karma/static/client.html
05 08 2015 16:38:36.002:DEBUG [web-server]: serving: /home/treguben/dev/here.com/node_modules/karma/static/karma.js
05 08 2015 16:38:36.024:DEBUG [karma]: A browser has connected on socket ZAs_vF1-u5Cgk-ghAAAA
05 08 2015 16:38:36.027:DEBUG [web-server]: upgrade /socket.io/?EIO=3&transport=websocket&sid=ZAs_vF1-u5Cgk-ghAAAA
05 08 2015 16:38:36.079:INFO [PhantomJS 1.9.8 (Linux 0.0.0)]: Connected on socket ZAs_vF1-u5Cgk-ghAAAA with id 80480871
05 08 2015 16:38:36.080:DEBUG [launcher]: PhantomJS (id 80480871) captured in 15.218 secs
    <snip>serving a bunch of files</snip>
PhantomJS 1.9.8 (Linux 0.0.0): Executed 26 of 26 SUCCESS (0.092 secs / 0.304 secs)
05 08 2015 16:38:36.533:DEBUG [karma]: Run complete, exiting.
05 08 2015 16:38:36.533:DEBUG [launcher]: Disconnecting all browsers
05 08 2015 16:38:36.534:DEBUG [coverage]: Writing coverage to /home/treguben/dev/here.com/tests/results/frontend_coverage/PhantomJS 1.9.8 (Linux 0.0.0)
05 08 2015 16:38:36.573:DEBUG [launcher]: Process PhantomJS exited with code 0
05 08 2015 16:38:36.574:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-80480871
05 08 2015 16:38:36.578:DEBUG [reporter.junit]: JUnit results written to "/home/treguben/dev/here.com/tests/results/frontend/PhantomJS_1.9.8_(Linux_0.0.0)/jasmine-test-results.xml".

Done, without errors.

@dignifiedquire
Copy link
Member

So I have tried the debug configuration and as soon as I put debug: true in it starts working fine. I comment the debug: true out, and it fails again.

Okay, that might actually help me :) it looks like this issue is a race condition due to the changes I made in 96e33dc

Let's see if I can fix that

@dignifiedquire
Copy link
Member

Okay, so please try out this pr #1546, you can install it by running

$ cd node_modules
$ rm -rf karma
$ git clone https://github.com/Dignifiedquire/karma
$ git checkout 1545-race-agains-phantom
$ npm i
$ npm i -g grunt-cli # If you don't already have grunt installed
$ grunt build
$ cd ../..

@kketch
Copy link

kketch commented Aug 5, 2015

Seems to work for me

@dignifiedquire
Copy link
Member

Seems to work for me

:) I'll wait for one more confirm and then release it

@kketch
Copy link

kketch commented Aug 5, 2015

Though for some reasons, I had to git clone your fork, checkout your branch instead of using npm install. The 'client' folder is missing with npm install and as a result static/karma.js is an 'empty' build when I follow your steps

@dignifiedquire
Copy link
Member

@kketch thanks, I had some typo in the npm install command I think, I've updated the installation details to use git, to ensure it works

@coderbyheart
Copy link

In my case it doesn't run the tests anymore with your karma version.

$ PATH="./node_modules/phantomjs/bin/phantomjs:$PATH" ./node_modules/karma/bin/karma start --browsers PhantomJS_custom test/karma/karma.conf.js
05 08 2015 17:41:55.419:DEBUG [plugin]: Loading karma-* from /home/m/www/finturanode/node_modules
05 08 2015 17:41:55.422:DEBUG [plugin]: Loading plugin /home/m/www/finturanode/node_modules/karma-browserstack-launcher.
05 08 2015 17:41:55.482:DEBUG [plugin]: Loading plugin /home/m/www/finturanode/node_modules/karma-chrome-launcher.
05 08 2015 17:41:55.486:DEBUG [plugin]: Loading plugin /home/m/www/finturanode/node_modules/karma-coverage.
05 08 2015 17:41:55.650:DEBUG [plugin]: Loading plugin /home/m/www/finturanode/node_modules/karma-jasmine.
05 08 2015 17:41:55.651:DEBUG [plugin]: Loading plugin /home/m/www/finturanode/node_modules/karma-phantomjs-launcher.
05 08 2015 17:41:55.671:DEBUG [plugin]: Loading inlined plugin (defining launcher:PhantomJS_custom).
05 08 2015 17:41:55.697:DEBUG [watcher]: Excluded file "/home/m/www/finturanode/bower_modules/jquery.inputmask/dist/jquery.inputmask.bundle.js"
05 08 2015 17:41:55.729:DEBUG [watcher]: Excluded file "/home/m/www/finturanode/bower_modules/intl-tel-input/build/js/intlTelInput.js"
05 08 2015 17:41:55.729:DEBUG [watcher]: Excluded file "/home/m/www/finturanode/bower_modules/intl-tel-input/lib/libphonenumber/build/utils.js"
05 08 2015 17:41:55.744:WARN [watcher]: All files matched by "/home/m/www/finturanode/bower_modules/jquery.inputmask/dist/jquery.inputmask.bundle.js" were excluded.
05 08 2015 17:41:55.745:WARN [watcher]: All files matched by "/home/m/www/finturanode/bower_modules/intl-tel-input/build/js/intlTelInput.js" were excluded.
05 08 2015 17:41:55.745:WARN [watcher]: All files matched by "/home/m/www/finturanode/bower_modules/intl-tel-input/lib/libphonenumber/build/utils.js" were excluded.
05 08 2015 17:41:55.769:INFO [karma]: Karma v0.13.6 server started at http://localhost:9876/
05 08 2015 17:41:55.779:INFO [launcher]: Starting browser PhantomJS
05 08 2015 17:41:55.779:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-77071060
05 08 2015 17:41:55.782:DEBUG [launcher]: /home/m/www/finturanode/node_modules/phantomjs/lib/phantom/bin/phantomjs --load-images=true --remote-debugger-port=9000 --remote-debugger-autorun=yes /tmp/karma-77071060/capture.js
05 08 2015 17:41:55.786:INFO [phantomjs.launcher]: ACTION REQUIRED:
05 08 2015 17:41:55.786:INFO [phantomjs.launcher]: 
05 08 2015 17:41:55.786:INFO [phantomjs.launcher]:   Launch browser at
05 08 2015 17:41:55.786:INFO [phantomjs.launcher]:   http://localhost:9000/webkit/inspector/inspector.html?page=2
05 08 2015 17:41:55.786:INFO [phantomjs.launcher]: 
05 08 2015 17:41:55.786:INFO [phantomjs.launcher]: Waiting 15 seconds ...
05 08 2015 17:41:55.864:DEBUG [phantomjs.launcher]: Launch the debugger page at http://localhost:9000/webkit/inspector/inspector.html?page=2
Waiting 15 seconds for debugger page to launch...

05 08 2015 17:42:10.873:DEBUG [phantomjs.launcher]: Launching page http://localhost:9876/?id=77071060...

05 08 2015 17:42:10.888:DEBUG [web-server]: serving: /home/m/www/finturanode/node_modules/karma/static/client.html
05 08 2015 17:42:10.902:DEBUG [web-server]: serving: /home/m/www/finturanode/node_modules/karma/static/karma.js
05 08 2015 17:42:55.802:WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
05 08 2015 17:42:55.810:DEBUG [launcher]: Process PhantomJS exited with code 0
05 08 2015 17:42:55.810:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-77071060
05 08 2015 17:42:55.817:INFO [launcher]: Trying to start PhantomJS again (1/2).
05 08 2015 17:42:55.818:DEBUG [launcher]: Restarting PhantomJS
05 08 2015 17:42:55.818:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-77071060
05 08 2015 17:42:55.820:DEBUG [launcher]: /home/m/www/finturanode/node_modules/phantomjs/lib/phantom/bin/phantomjs --load-images=true --remote-debugger-port=9000 --remote-debugger-autorun=yes /tmp/karma-77071060/capture.js --remote-debugger-port=9000 --remote-debugger-autorun=yes /tmp/karma-77071060/capture.js
05 08 2015 17:42:55.825:INFO [phantomjs.launcher]: ACTION REQUIRED:
05 08 2015 17:42:55.825:INFO [phantomjs.launcher]: 
05 08 2015 17:42:55.825:INFO [phantomjs.launcher]:   Launch browser at
05 08 2015 17:42:55.825:INFO [phantomjs.launcher]:   http://localhost:9000/webkit/inspector/inspector.html?page=2
05 08 2015 17:42:55.825:INFO [phantomjs.launcher]: 
05 08 2015 17:42:55.826:INFO [phantomjs.launcher]: Waiting 15 seconds ...
05 08 2015 17:42:55.958:DEBUG [phantomjs.launcher]: Launch the debugger page at http://localhost:9000/webkit/inspector/inspector.html?page=2
Waiting 15 seconds for debugger page to launch...

05 08 2015 17:43:10.972:DEBUG [phantomjs.launcher]: Launching page http://localhost:9876/?id=77071060...

05 08 2015 17:43:10.975:DEBUG [web-server]: serving (cached): /home/m/www/finturanode/node_modules/karma/static/client.html
05 08 2015 17:43:10.984:DEBUG [web-server]: serving (cached): /home/m/www/finturanode/node_modules/karma/static/karma.js

@kketch
Copy link

kketch commented Aug 5, 2015

@coderbyheart I experimented the same behavior, and this was because I installed karma through npm install, in this case you may have a failed build of static/karma.js like me. Follow the updated steps above (using git clone instead of npm install) and I think you should be fine.

@coderbyheart
Copy link

Awesome. Works!

05 08 2015 17:51:33.264:INFO [karma]: Karma v0.13.6 server started at http://localhost:9876/

$ npm list | grep phantom
│ ├── karma-phantomjs-launcher@0.2.1 extraneous
│ ├── phantomjs@1.9.17 extraneous
├─┬ karma-phantomjs-launcher@0.2.1
├─┬ phantomjs@1.9.17

@dignifiedquire
Copy link
Member

Released as 0.13.7

Thanks everyone for all the help!

@albertosantini
Copy link
Author

With 0.13.7, for me, it is ok locally on Windows 10 and Travis CI.
Good job. Thanks folks.

@coderbyheart
Copy link

Thanks for fixing this so quickly!

@BairDev
Copy link

BairDev commented Jan 6, 2016

I've seen the same error message for 0.13.7 and 0.13.10.

... % npm list | grep phantom                                       :(
├─┬ karma-phantomjs-launcher@0.2.1
└─┬ phantomjs@1.9.19

... % npm list | grep karma
├─┬ grunt-karma@0.12.1
├─┬ karma@0.13.7
├── karma-jasmine@0.3.6
├─┬ karma-phantomjs-launcher@0.2.1
├─┬ karma-systemjs@0.9.0

The Error goes like:

06 01 2016 09:51:27.830:INFO [karma]: Karma v0.13.7 server started at http://localhost:9876/
06 01 2016 09:51:27.838:INFO [launcher]: Starting browser PhantomJS
06 01 2016 09:51:27.839:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-8049600
06 01 2016 09:51:27.840:DEBUG [launcher]: /path/to/project/node_modules/phantomjs/lib/phantom/bin/phantomjs /tmp/karma-8049600/capture.js
06 01 2016 09:51:27.964:DEBUG [web-server]: serving: /path/to/project/node_modules/karma/static/client.html
06 01 2016 09:51:27.972:DEBUG [web-server]: serving: /path/to/project/node_modules/karma/static/karma.js
06 01 2016 09:51:28.002:DEBUG [karma]: A browser has connected on socket oZco5FFbyFTwV_wfAAAA
06 01 2016 09:51:28.006:DEBUG [web-server]: upgrade /socket.io/?EIO=3&transport=websocket&sid=oZco5FFbyFTwV_wfAAAA
06 01 2016 09:51:28.068:INFO [PhantomJS 1.9.8 (Linux 0.0.0)]: Connected on socket oZco5FFbyFTwV_wfAAAA with id 8049600
06 01 2016 09:51:28.068:DEBUG [launcher]: PhantomJS (id 8049600) captured in 0.238 secs
06 01 2016 09:51:28.073:DEBUG [web-server]: serving: /path/to/project/node_modules/karma/static/context.html
06 01 2016 09:51:28.075:DEBUG [web-server]: serving (cached): /path/to/project/node_modules/karma-systemjs/lib/adapter.js
PhantomJS 1.9.8 (Linux 0.0.0) ERROR
  You need to include some adapter that implements __karma__.start method!


06 01 2016 09:51:28.122:DEBUG [karma]: Run complete, exiting.
06 01 2016 09:51:28.124:DEBUG [launcher]: Disconnecting all browsers
06 01 2016 09:51:28.128:DEBUG [launcher]: Process PhantomJS exited with code 0
06 01 2016 09:51:28.128:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-8049600

For me it looks quite similar to @arty-name's debug output. But it might be related to our use of systemjs.

@mhintz
Copy link

mhintz commented Jan 26, 2016

I'm getting this error with karma 0.13.19, OSX 10.10.5, with a very simple karma.conf.js and a very simple test file.

// karma.conf.js

module.exports = function (karmaConfig) {
  karmaConfig.set({

    browsers: ['Chrome'],

    files: [
      'src/test.js'
    ],

    preprocessors: {
      // normally, with karma-webpack
      // '**/*': ['webpack']
    }
  });
}
// src/test.js

/*
some commented out tests...
*/

console.log('tests loaded');

// Error appears even when this file is empty

The error:

26 01 2016 17:48:44.173:WARN [karma]: No captured browser, open http://localhost:9876/
26 01 2016 17:48:44.186:INFO [karma]: Karma v0.13.19 server started at http://localhost:9876/
26 01 2016 17:48:44.198:INFO [launcher]: Starting browser Chrome
26 01 2016 17:48:45.118:INFO [Chrome 47.0.2526 (Mac OS X 10.10.5)]: Connected on socket /#Yst37oxFOulgnqbAAAAA with id 5510292
Chrome 47.0.2526 (Mac OS X 10.10.5) LOG: 'tests loaded'

Chrome 47.0.2526 (Mac OS X 10.10.5) ERROR
  You need to include some adapter that implements __karma__.start method!

I'll look into the code and see if I can find something

Edit:
The also happens in Firefox.

launcher versions:

"karma-chrome-launcher": "^0.2.2",
"karma-firefox-launcher": "^0.1.7",

@dignifiedquire
Copy link
Member

@mhintz you need to include a testing framework like mocha, jasmine or qunit, that's what the error is about.

@mhintz
Copy link

mhintz commented Jan 26, 2016

Aha, thanks! I had been including the karma-unexpected plugin, but that looks like it's terribly outdated. I'm working on a fork now.

@quantuminformation
Copy link

I'm not having luck with chrome:

Chrome 49.0.2623 (Mac OS X 10.10.4) ERROR
You need to include some adapter that implements karma.start method!

@thilinamgit
Copy link

I'm getting the same error ( karma.start method!) with below,
"karma": "1.3.0",
"karma-browserify": "^5.0.5",
"karma-chrome-launcher": "2.0.0",
"karma-coffee-preprocessor": "^1.0.0",
"karma-coverage": "~1.1.0",
"karma-jasmine": "1.0.2",
"karma-junit-reporter": "^1.1.0",
"karma-phantomjs-launcher": "1.0.2",
"merge-stream": "^1.0.0",
"phantomjs-prebuilt": "2.1.12",

Debug output is as follows:
[exec] 02 10 2016 21:22:28.479:DEBUG [web-server]: serving: /path/node_modules/karma/static/context.js
[exec] PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
[exec] You need to include some adapter that implements karma.start method!
[exec] PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 0 of 0 ERROR (1.005 secs / 0 secs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
10 participants