theintern / intern

A next-generation code testing stack for JavaScript.
https://theintern.io/
Other
4.36k stars 309 forks source link

TypeError: Cannot read property '0' of null when running on Travis-CI from ^2.1.0 #299

Closed zanona closed 9 years ago

zanona commented 9 years ago

Apparently when running tests through Travis won't get executed after the following exception:

$ ./node_modules/.bin/intern-runner --config=tests/intern
Listening on 0.0.0.0:9000
Starting tunnel...
TypeError: Cannot read property '0' of null
  at runCallbacks  <node_modules/intern-geezer/node_modules/digdug/node_modules/dojo/Promise.js:12:51>
  at Object.run [as _onImmediate]  <node_modules/intern-geezer/node_modules/digdug/node_modules/dojo/Promise.js:143:29>
  at processImmediate [as _immediateCallback]  <timers.js:345:15>

steps to reproduce

The issues happens from intern version 2.1.0 both from main and geezer branches. The last working version seems to be 2.0.3

csnover commented 9 years ago

I’m not sure why this is happening only on Travis and not my local environment, maybe because their connections are faster.

There is a bug/race condition in the upstream Dojo 2 library where if progress callbacks are scheduled on the same turn as a settlement, or someone attempts to send a progress notification after the promise has settled, the progress callbacks are null and it crashes.

You can work around this temporarily with this extra command before running Intern:

sed -i -e 's/callbacks = progressCallbacks = null;//' node_modules/intern-geezer/node_modules/digdug/node_modules/dojo/Promise.js
zanona commented 9 years ago

Thanks for taking a look into this @csnover. I believe you are correct in regards the connection speed. I've noticed the same issue happened when testing under codeship.io so that might be true indeed.

I will try the sed command as a work around for the moment.