diff --git a/test/simple/test-http-default-encoding.js b/test/simple/test-http-default-encoding.js index b06f7c83a20472..d2c342c244cd2f 100644 --- a/test/simple/test-http-default-encoding.js +++ b/test/simple/test-http-default-encoding.js @@ -31,16 +31,11 @@ var server = http.Server(function(req, res) { req.on('data', function(chunk) { result += chunk; }).on('end', function() { - clearTimeout(timeout); server.close(); + res.writeHead(200); + res.end('hello world\n'); }); - var timeout = setTimeout(function() { - process.exit(1); - }, 100); - - res.writeHead(200); - res.end('hello world\n'); }); server.listen(common.PORT, function() { diff --git a/test/simple/test-http-request-end.js b/test/simple/test-http-request-end.js index f64dcc305adaa0..a4cd61a3fa98f1 100644 --- a/test/simple/test-http-request-end.js +++ b/test/simple/test-http-request-end.js @@ -34,10 +34,10 @@ var server = http.Server(function(req, res) { req.on('end', function() { server.close(); + res.writeHead(200); + res.end('hello world\n'); }); - res.writeHead(200); - res.end('hello world\n'); }); server.listen(common.PORT, function() {