One more test with a race condition fixed

This commit is contained in:
Bert Belder
2010-08-13 05:23:41 +02:00
committed by Ryan Dahl
parent d8642a8aa6
commit 0e8d858aba

View File

@@ -7,11 +7,13 @@ http = require("http");
// It is separate from test-http-malformed-request.js because it is only
// reproduceable on the first packet on the first connection to a server.
server = http.createServer(function (req, res) {});
var server = http.createServer(function (req, res) {});
server.listen(common.PORT);
net.createConnection(common.PORT).addListener("connect", function () {
this.close();
}).addListener("close", function () {
server.close();
});
server.addListener("listening", function() {
net.createConnection(common.PORT).addListener("connect", function () {
this.close();
}).addListener("close", function () {
server.close();
});
});