test: fix tests after ECONNRESET patch

pull/24504/head
Fedor Indutny 2013-02-12 15:00:13 +04:00
parent e235bce2ba
commit c34326b286
2 changed files with 9 additions and 0 deletions

View File

@ -34,6 +34,7 @@ var https = require('https');
var proxyPort = common.PORT + 1;
var gotRequest = false;
var errorCount = 0;
var key = fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem');
var cert = fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem');
@ -162,10 +163,13 @@ proxy.listen(proxyPort, function() {
proxy.close();
server.close();
});
}).on('error', function() {
errorCount++;
}).end();
}
});
process.on('exit', function() {
assert.ok(gotRequest);
assert.equal(errorCount, 1);
});

View File

@ -50,9 +50,13 @@ function doTest() {
requestCert: true
};
var requestCount = 0;
var errorCount = 0;
var session;
var server = tls.createServer(options, function(cleartext) {
cleartext.on('error', function() {
errorCount++;
});
++requestCount;
cleartext.end();
});
@ -94,5 +98,6 @@ function doTest() {
// initial request + reconnect requests (5 times)
assert.equal(requestCount, 6);
assert.equal(errorCount, 4);
});
}