mirror of https://github.com/nodejs/node.git
test: fix tests after ECONNRESET patch
parent
e235bce2ba
commit
c34326b286
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue