xolvio / meteor-rtd-example-project

A template project to use for creating a meteor app with unit and webdriver testing
91 stars 27 forks source link

Crashes on unit tests #11

Closed wackazong closed 11 years ago

wackazong commented 11 years ago

Hey, I installed it as prescribed, started it with grunt, modified a file and I get:

grunt --debug
[D] Task source: /Users/alexanderwalter/Development/meteor-test/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee
[D] Task source: /Users/alexanderwalter/Development/meteor-test/test/rtd/Gruntfile.js
[D] Task source: /Users/alexanderwalter/Development/meteor-test/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee
[D] Task source: /Users/alexanderwalter/Development/meteor-test/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee
[D] Task source: /Users/alexanderwalter/Development/meteor-test/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee
[D] Task source: /Users/alexanderwalter/Development/meteor-test/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee
[D] Task source: /Users/alexanderwalter/Development/meteor-test/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee
[D] Task source: /Users/alexanderwalter/Development/meteor-test/test/rtd/node_modules/grunt-contrib-watch/tasks/watch.js
Waiting...[D] Task source: /Users/alexanderwalter/Development/meteor-test/test/rtd/node_modules/grunt-bg-shell/tasks/bg-shell.coffee

- - - Running unit tests - - -
>> Error: Command failed:
Fatal error: Command failed: 
>> Error: Command failed:
Fatal error: Command failed: 

Any pointers?

System is Mac 10.8.3

├── freeport@1.0.0
├─┬ grunt@0.4.1
│ ├── async@0.1.22
│ ├── coffee-script@1.3.3
│ ├── colors@0.6.0-1
│ ├── dateformat@1.0.2-1.2.3
│ ├── eventemitter2@0.4.11
│ ├─┬ findup-sync@0.1.2
│ │ └── lodash@1.0.1
│ ├─┬ glob@3.1.21
│ │ ├── graceful-fs@1.2.1
│ │ └── inherits@1.0.0
│ ├── hooker@0.2.3
│ ├── iconv-lite@0.2.10
│ ├─┬ js-yaml@2.0.5
│ │ ├─┬ argparse@0.1.15
│ │ │ ├── underscore@1.4.4
│ │ │ └── underscore.string@2.3.1
│ │ └── esprima@1.0.3
│ ├── lodash@0.9.2
│ ├─┬ minimatch@0.2.12
│ │ ├── lru-cache@2.3.0
│ │ └── sigmund@1.0.0
│ ├─┬ nopt@1.0.10
│ │ └── abbrev@1.0.4
│ ├─┬ rimraf@2.0.3
│ │ └── graceful-fs@1.1.14
│ ├── underscore.string@2.2.0rc
│ └── which@1.0.5
├── grunt-bg-shell@2.0.1
├─┬ grunt-contrib-watch@0.3.1
│ └─┬ gaze@0.3.4
│   ├─┬ fileset@0.1.5
│   │ └─┬ glob@3.2.1
│   │   ├── graceful-fs@1.2.1
│   │   └── inherits@1.0.0
│   └─┬ minimatch@0.2.12
│     ├── lru-cache@2.3.0
│     └── sigmund@1.0.0
├── grunt-exec@0.4.1
├─┬ grunt-istanbul@0.2.1
│ ├─┬ istanbul@0.1.36
│ │ ├── abbrev@1.0.4
│ │ ├── async@0.2.9
│ │ ├─┬ escodegen@0.0.22
│ │ │ ├── estraverse@0.0.4
│ │ │ └─┬ source-map@0.1.22
│ │ │   └── amdefine@0.0.5
│ │ ├── esprima@1.0.3
│ │ ├─┬ fileset@0.1.5
│ │ │ ├─┬ glob@3.2.1
│ │ │ │ ├── graceful-fs@1.2.1
│ │ │ │ └── inherits@1.0.0
│ │ │ └─┬ minimatch@0.2.12
│ │ │   ├── lru-cache@2.3.0
│ │ │   └── sigmund@1.0.0
│ │ ├─┬ handlebars@1.0.12
│ │ │ ├── optimist@0.3.7
│ │ │ └─┬ uglify-js@2.3.6
│ │ │   └─┬ source-map@0.1.22
│ │ │     └── amdefine@0.0.5
│ │ ├── mkdirp@0.3.5
│ │ ├── nopt@2.1.1
│ │ ├── resolve@0.3.1
│ │ ├── which@1.0.5
│ │ └── wordwrap@0.0.2
│ └── nue@0.7.0dev
├─┬ grunt-zip@0.9.0
│ ├── grunt-retro@0.6.2
│ └── node-zip@0.0.2
├── hash_file@0.0.8
├─┬ request@2.21.0
│ ├── aws-sign@0.3.0
│ ├── cookie-jar@0.3.0
│ ├── forever-agent@0.5.0
│ ├─┬ form-data@0.0.8
│ │ ├── async@0.2.9
│ │ └─┬ combined-stream@0.0.4
│ │   └── delayed-stream@0.0.5
│ ├─┬ hawk@0.13.1
│ │ ├─┬ boom@0.4.2
│ │ │ └── hoek@0.9.1
│ │ ├── cryptiles@0.2.1
│ │ ├── hoek@0.8.5
│ │ └─┬ sntp@0.2.4
│ │   └── hoek@0.9.1
│ ├─┬ http-signature@0.9.11
│ │ ├── asn1@0.1.11
│ │ ├── assert-plus@0.1.2
│ │ └── ctype@0.5.2
│ ├── json-stringify-safe@4.0.0
│ ├── mime@1.2.9
│ ├── node-uuid@1.4.0
│ ├── oauth-sign@0.3.0
│ ├── qs@0.6.5
│ └── tunnel-agent@0.3.0
└── selenium-webdriver@2.31.0
xolvio commented 11 years ago

Hey there

Typically that error means a compilation problem with the unit tests, or the main app code.

Can you try to run this from the command line when RTD is running:

karma run

This will tell karma to run the tests once. Let me know if the error messages there shed any light

wackazong commented 11 years ago

What I did: in mygitclone/test/rtd I started grunt in one shell in mygitclone/test/rtd I executed karma run Nothing happens for about 30 secs, then both processes end and the grunt process displays

Error: Command failed: Fatal error: Command failed:

xolvio commented 11 years ago

Thanks.

After starting RTD, could you try and hit your app on port 3000 and port 8000 and see it's working there, then type karma run, I'm trying to isolate if it's a test timeout issue or RTD starting up.

xolvio commented 11 years ago

The other thing to try, is to comment out any references to 'bgShell:instrumentCode' in /test/rtd/Gruntfile.js I'm wondering if the instrumentation is meddling with coffee script.

wackazong commented 11 years ago

Commented out 'bgshell:instrumentCode', rtd serves app on 8000 and 3000. Still, same behaviour.

wackazong commented 11 years ago

After rtd crashes, a ps -ef | grep meteor reveals:

  502  3847     1   0  8:22am ttys000    0:01.22 /usr/bin/java -jar /Users/alexanderwalter/Development/meteor-test/test/rtd/lib/bin/selenium-server-standalone-2.32.0.jar -port 4444 -Dwebdriver.chrome.driver=/Users/alexanderwalter/Development/meteor-test/test/rtd/lib/bin/chromedriver
  502  3855     1   0  8:22am ttys000    0:00.00 /bin/sh -c cd /Users/alexanderwalter/Development/meteor-test/test/rtd/../../test/rtd/mirror_app;meteor run --port 8000  > /dev/null;
  502  3856  3855   0  8:22am ttys000    0:03.40 /Users/alexanderwalter/.meteor/tools/11f45b3996/bin/node /Users/alexanderwalter/.meteor/tools/11f45b3996/tools/meteor.js run --port 8000
  502  3874     1   0  8:22am ttys000    0:00.00 /bin/sh -c cd /Users/alexanderwalter/Development/meteor-test/test/rtd/../../app;meteor run --port 3000 > /dev/null;
  502  3875  3874   0  8:22am ttys000    0:02.48 /Users/alexanderwalter/.meteor/tools/11f45b3996/bin/node /Users/alexanderwalter/.meteor/tools/11f45b3996/tools/meteor.js run --port 3000
  502  3892  3856   0  8:22am ttys000    0:06.47 /Users/alexanderwalter/.meteor/tools/11f45b3996/mongodb/bin/mongod --bind_ip 127.0.0.1 --smallfiles --port 8002 --dbpath /Users/alexanderwalter/Development/meteor-test/test/rtd/mirror_app/.meteor/local/db
  502  3895  3875   0  8:22am ttys000    0:06.48 /Users/alexanderwalter/.meteor/tools/11f45b3996/mongodb/bin/mongod --bind_ip 127.0.0.1 --smallfiles --port 3002 --dbpath /Users/alexanderwalter/Development/meteor-test/app/.meteor/local/db
  502  3901  3875   0  8:22am ttys000    0:01.21 /Users/alexanderwalter/.meteor/tools/11f45b3996/bin/node /Users/alexanderwalter/Development/meteor-test/app/.meteor/local/build/main.js --keepalive
  502  3902  3856   0  8:22am ttys000    0:01.19 /Users/alexanderwalter/.meteor/tools/11f45b3996/bin/node /Users/alexanderwalter/Development/meteor-test/test/rtd/mirror_app/.meteor/local/build/main.js --keepalive
xolvio commented 11 years ago

all the processes look normal from here.

If possible, would you mind sending me the app (cut out any private code) so that I can debug? This one seems quite odd! sam @ xolv dot io

xolvio commented 11 years ago

Thank you for sending that through, it works here just fine so that tells me it's an environmental problem on your machine setup.

which version of phantomjs to you have? Try changing PhantomJS to Chrome in karma.conf

wackazong commented 11 years ago

Yeah, that does it. All up and running now.

phantomjs is 1.9.0. Installed via npm install -g phantomjs

wackazong commented 11 years ago

Ok, it seems to be this issue here: https://github.com/karma-runner/karma/blob/master/lib/server.js#L43

I followed the quick fix suggestion (https://github.com/karma-runner/karma/issues/558#issuecomment-18707232) and it works now.

Quick sidenote: is there a better way to refer to other issues and comments on github?

xolvio commented 11 years ago

Excellent. Glad it's resolved and good to know there's a Karma issue with the latest node.

Not sure how to refer to other comments, my github-fu is not up to scratch!