test: fix broken FreeBSD test
authorSantiago Gimeno <santiago.gimeno@gmail.com>
Wed, 3 Jun 2015 07:13:56 +0000 (09:13 +0200)
committerBrendan Ashworth <brendan.ashworth@me.com>
Wed, 3 Jun 2015 20:38:03 +0000 (13:38 -0700)
Fixes net-server-max-connections-close-makes-more-available
Handles connection 'error' event so the test ends.

PR-URL: https://github.com/nodejs/io.js/pull/1881
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
test/parallel/test-net-server-max-connections-close-makes-more-available.js

index a482be7..1569e85 100644 (file)
@@ -28,6 +28,11 @@ var createConnection = function(index) {
       sent.push(msg);
     });
 
+    connection.on('error', function(err) {
+      assert.equal(err.code, 'ECONNRESET');
+      resolve();
+    });
+
     connection.on('data', function(e) {
       console.error('connection ' + index + ' received response');
       resolve();