diff --git a/test/simple/test-http-conn-reset.js b/test/simple/test-http-conn-reset.js index 908d433c17..9c293721cf 100644 --- a/test/simple/test-http-conn-reset.js +++ b/test/simple/test-http-conn-reset.js @@ -45,7 +45,6 @@ function onListen() { }); req.on('error', function(err) { assert.equal(err.code, 'ECONNRESET'); - assert.equal(err.message, 'socket hang up'); caughtError = true; }); req.end(); diff --git a/test/simple/test-http-multi-line-headers.js b/test/simple/test-http-multi-line-headers.js index a212a04da5..92bf9ecc82 100644 --- a/test/simple/test-http-multi-line-headers.js +++ b/test/simple/test-http-multi-line-headers.js @@ -40,10 +40,8 @@ var server = net.createServer(function(conn) { '\r\n' + body; - conn.write(response, function() { - conn.destroy(); - server.close(); - }); + conn.end(response); + server.close(); }); server.listen(common.PORT, function() { @@ -51,6 +49,7 @@ server.listen(common.PORT, function() { assert.equal(res.headers['content-type'], 'text/plain;x-unix-mode=0600;name="hello.txt"'); gotResponse = true; + res.destroy(); }); }); diff --git a/test/simple/test-http-response-no-headers.js b/test/simple/test-http-response-no-headers.js index cc5250d826..d16d8a4ce9 100644 --- a/test/simple/test-http-response-no-headers.js +++ b/test/simple/test-http-response-no-headers.js @@ -41,9 +41,7 @@ function test(httpVersion, callback) { var reply = 'HTTP/' + httpVersion + ' 200 OK\r\n\r\n' + expected[httpVersion]; - conn.write(reply, function() { - conn.destroy(); - }); + conn.end(reply); }); server.listen(common.PORT, '127.0.0.1', function() {