From 11f673e819d79f07dbb42b75a5b070af66fcb4a5 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 22 Apr 2010 15:48:57 -0700 Subject: [PATCH] curl after server is listening --- test/simple/test-http-304.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/simple/test-http-304.js b/test/simple/test-http-304.js index 9aadad4857..d21cc94af2 100644 --- a/test/simple/test-http-304.js +++ b/test/simple/test-http-304.js @@ -9,11 +9,15 @@ s = http.createServer(function (request, response) { response.end(); }) s.listen(8000); +sys.puts('Server running at http://127.0.0.1:8000/') + +s.addListener('listening', function () { + + childProcess.exec('curl http://127.0.0.1:8000/', function (err, stdout, stderr) { + if (err) throw err; + s.close(); + sys.puts('curled response correctly'); + }); -childProcess.exec('curl http://127.0.0.1:8000/', function (err, stdout, stderr) { - if (err) throw err; - s.close(); - sys.puts('curled response correctly'); }); -sys.puts('Server running at http://127.0.0.1:8000/')