diff options
Diffstat (limited to 'test/pummel/test-http-client-reconnect-bug.js')
-rw-r--r-- | test/pummel/test-http-client-reconnect-bug.js | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/test/pummel/test-http-client-reconnect-bug.js b/test/pummel/test-http-client-reconnect-bug.js index 7b9b8b0da1..395a538178 100644 --- a/test/pummel/test-http-client-reconnect-bug.js +++ b/test/pummel/test-http-client-reconnect-bug.js @@ -1,47 +1,27 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); const net = require('net'); const http = require('http'); -var errorCount = 0; -var eofCount = 0; - var server = net.createServer(function(socket) { socket.end(); }); -server.on('listening', function() { +server.on('listening', common.mustCall(function() { var client = http.createClient(common.PORT); - client.on('error', function(err) { - // We should receive one error - console.log('ERROR! ' + err.message); - errorCount++; - }); - - client.on('end', function() { - // When we remove the old Client interface this will most likely have to be - // changed. - console.log('EOF!'); - eofCount++; - }); + client.on('error', common.mustCall(function(err) {})); + client.on('end', common.mustCall(function() {})); var request = client.request('GET', '/', {'host': 'localhost'}); request.end(); request.on('response', function(response) { console.log('STATUS: ' + response.statusCode); }); -}); +})); server.listen(common.PORT); setTimeout(function() { server.close(); }, 500); - - -process.on('exit', function() { - assert.equal(1, errorCount); - assert.equal(1, eofCount); -}); |