Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Test suite fails horribly #329

Closed
DanielBaulig opened this Issue · 12 comments

5 participants

@DanielBaulig

If I clone connect and try running the test suite using

~/connect$ npm install -g
~/connect$ make test

I get the following output:

   ~/connect$ make test
   uncaught: Error: ECONNREFUSED, Connection refused
    at Socket._onConnect (net_legacy.js:601:18)
    at IOWatcher.onWritable [as callback] (net_legacy.js:186:12)


   uncaught: Error: ECONNREFUSED, Connection refused
    at Socket._onConnect (net_legacy.js:601:18)
    at IOWatcher.onWritable [as callback] (net_legacy.js:186:12)


   uncaught: Error: ECONNREFUSED, Connection refused
    at Socket._onConnect (net_legacy.js:601:18)
    at IOWatcher.onWritable (net_legacy.js:186:12)


   uncaught: Error: ECONNREFUSED, Connection refused
    at Socket._onConnect (net_legacy.js:601:18)
    at IOWatcher.onWritable (net_legacy.js:186:12)


   uncaught: Error: ECONNREFUSED, Connection refused
    at Socket._onConnect (net_legacy.js:601:18)
    at IOWatcher.onWritable (net_legacy.js:186:12)


   uncaught: AssertionError: test with wildcard. Invalid response header Content-Type.
    Expected: text/html; charset=utf8
    Got: text/plain
    at IncomingMessage.<anonymous> (/home/user/connect/node_modules/expresso/bin/expresso:469:32)
    at IncomingMessage.emit (events.js:86:20)
    at HTTPParser.onMessageComplete (http.js:133:23)
    at Client.onData [as ondata] (http.js:1506:27)
    at Client._onReadable (net_legacy.js:683:27)
    at IOWatcher.onReadable [as callback] (net_legacy.js:177:10)


   uncaught: AssertionError: test with wildcard. Invalid response body.
    Expected: '/foo'
    Got: 'Cannot GET /foo/'
    at IncomingMessage.<anonymous> (/home/user/connect/node_modules/expresso/bin/expresso:440:28)
    at IncomingMessage.emit (events.js:86:20)
    at HTTPParser.onMessageComplete (http.js:133:23)
    at Client.onData [as ondata] (http.js:1506:27)
    at Client._onReadable (net_legacy.js:683:27)
    at IOWatcher.onReadable [as callback] (net_legacy.js:177:10)

After this output the testsuite hangs and will not continue. I'm running on node 0.5.1. What am I doing wrong or am I missing?
My npm ls

connect@1.6.0 /home/user/connect
├── ejs@0.4.3
├── expresso@0.7.6
├── koala@0.1.2
├── less@1.1.1
├── markdown@0.2.1
├── mime@1.2.2
├── qs@0.3.0
├── sass@0.5.0
└── should@0.2.1
@tj
Owner
tj commented

install -g is global, just npm install or npm install -d for logging, also you'll want to ulimit -n 8888 etc, if you have a low fd limit this will fail

@tj
Owner
tj commented

and make sure you are on the 2.x branch, but as for node 0.5.x, I have not even begun to support it so it will likely fail

@DanielBaulig

Hey thank you for your reply. I erred on npm install -g, of course I meant npm install -d. It also fails on 0.4.9 with very similar errors (but less ECONNREFUSED). My ulimit is set to unlimited.
There is no 2.x branch in the git repository. There are only 1.x, master, gh-pages and features/staticProvider-cache. I am on master, latest commit.
I'm wondering: to what host:port does the test suite connect? Maybe my packet filter is interfering. I guess I can look this up myself though. Any other suggestions what might cause this?

@tj
Owner
tj commented

the port range starts at 5555, we could use ephemeral ports but I haven't gotten around to it

@DanielBaulig

Hm.. I tried running the test suite with all my packet filters disabled, but to no success. Also, running netstat | grep WAIT | wc -l after the test suite failed only gives me roughly 130 TIME_WAIT ports. So shouldn't fail due to running out of fd or ports.
I also checked if there are any ports used in the specified range (5000+). The next in use on my system is at 8000, that's my development node process. To be sure, I stopped it, but that didn't change anything either. The test suite seems to also use some 9000+ ports, but also: nothing is blocking those.
I don't know. Maybe the test suite just doesn't like me ;)

@tj
Owner
tj commented

did you try with 0.4.x?

@tj
Owner
tj commented

(i see the legacy net stuff there)

@DanielBaulig

It also fails on 0.4.9 with very similar errors (but less ECONNREFUSED)

:(

@DanielBaulig

switched to 0.4.9

$ sudo n 0.4.9

reinstalled node_modules

$ rm -rf node_modules ; npm install

ran test suite

$ make test

output

 uncaught: Error: ECONNREFUSED, Connection refused
    at Socket._onConnect (net.js:601:18)
    at IOWatcher.onWritable [as callback] (net.js:186:12)


   uncaught: AssertionError: test with wildcard. Invalid response header Content-Type.
    Expected: text/html; charset=utf8
    Got: text/plain
    at IncomingMessage.<anonymous> (/home/user/connect/node_modules/expresso/bin/expresso:469:32)
    at IncomingMessage.emit (events.js:81:20)
    at HTTPParser.onMessageComplete (http.js:133:23)
    at Client.onData [as ondata] (http.js:1485:27)
    at Client._onReadable (net.js:683:27)
    at IOWatcher.onReadable [as callback] (net.js:177:10)


   uncaught: AssertionError: test with wildcard. Invalid response body.
    Expected: '/foo'
    Got: 'Cannot GET /foo/'
    at IncomingMessage.<anonymous> (/home/user/connect/node_modules/expresso/bin/expresso:440:28)
    at IncomingMessage.emit (events.js:81:20)
    at HTTPParser.onMessageComplete (http.js:133:23)
    at Client.onData [as ondata] (http.js:1485:27)
    at Client._onReadable (net.js:683:27)
    at IOWatcher.onReadable [as callback] (net.js:177:10)

I guess I'll just have to wait until it magically fixes itself... :-/

@tj
Owner
tj commented

very odd, both 1.x and master are 100% for me

@xippi

same issue here. node 0.4.10

@ryanrolds

I'm also getting:

uncaught: Error: ECONNREFUSED, Connection refused
    at Socket._onConnect (net.js:601:18)
    at IOWatcher.onWritable [as callback] (net.js:186:12)

It's coming from session.test.js. After disabling the session tests the test suite completes fine with 100%.

@ryanrolds ryanrolds referenced this issue from a commit in ryanrolds/connect
@ryanrolds ryanrolds Fixed race condition causing errors reported in #329. 1ba94d8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.