Blob Blame History Raw
commit 7c515248909503ba77e196af5f33246b72829619
Author: Tom Hughes <tom@compton.nu>
Date:   Thu Oct 8 21:34:50 2015 +0100

    Patch out test that relies on internet access

diff --git a/test/agent.test.js b/test/agent.test.js
index 4cdf6a4..f0226f0 100644
--- a/test/agent.test.js
+++ b/test/agent.test.js
@@ -732,51 +732,6 @@ describe('agent.test.js', function () {
     });
   });
 
-  it('should timeout and remove free socket', function (done) {
-    done = pedding(2, done);
-    var _keepaliveAgent = new Agent({
-      maxSockets: 1,
-      maxFreeSockets: 1,
-      keepAliveTimeout: 1000
-    });
-
-    var options = {
-      hostname: 'www.taobao.com',
-      port: 80,
-      path: '/',
-      method: 'GET',
-      agent : _keepaliveAgent
-    };
-
-    var index = 0;
-    var getRequest = function() {
-      var currentIndex = index++;
-      var req =  http.request(options, function(res) {
-        var size = 0;
-        res.on('data', function(chunk) {
-          size += chunk.length;
-        });
-        res.on('end', function() {
-          console.log('#%d req end, size: %d', currentIndex, size);
-          done();
-        });
-      });
-      req.on('error', done);
-      return req;
-    };
-
-    var req = getRequest();
-    // Get a reference to the socket.
-    req.on('socket', function(sock) {
-      // Listen to timeout and send another request immediately.
-      sock.on('timeout', function() {
-        console.log('socket:%s timeout', sock._host);
-        getRequest().end();
-      });
-    });
-    req.end();
-  });
-
   describe('keepAlive = false', function () {
     it('should close socket after request', function (done) {
       var name = 'localhost:' + port + '::';