Browse Source

test-http-client-reconnect-bug: hang up should be error.

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
7a16e2a2a0
  1. 6
      test/pummel/test-http-client-reconnect-bug.js

6
test/pummel/test-http-client-reconnect-bug.js

@ -11,11 +11,12 @@ var eofCount = 0;
var server = net.createServer(function(socket) { var server = net.createServer(function(socket) {
socket.end(); socket.end();
}); });
server.on('listening', function() { server.on('listening', function() {
var client = http.createClient(common.PORT); var client = http.createClient(common.PORT);
client.addListener('error', function(err) { client.addListener('error', function(err) {
console.log('ERROR! ' + (err.stack || err)); console.log('ERROR! ' + err.message);
errorCount++; errorCount++;
}); });
@ -30,6 +31,7 @@ server.on('listening', function() {
console.log('STATUS: ' + response.statusCode); console.log('STATUS: ' + response.statusCode);
}); });
}); });
server.listen(common.PORT); server.listen(common.PORT);
setTimeout(function() { setTimeout(function() {
@ -38,6 +40,6 @@ setTimeout(function() {
process.addListener('exit', function() { process.addListener('exit', function() {
assert.equal(0, errorCount); assert.equal(1, errorCount);
assert.equal(1, eofCount); assert.equal(1, eofCount);
}); });

Loading…
Cancel
Save