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');
server.close();
});
}).on('error', function() {
- errorCount++;
+ // We're ok with getting ECONNRESET in this test, but it's
+ // timing-dependent, and thus unreliable. Any other errors
+ // are just failures, though.
+ if (er.code !== 'ECONNRESET')
+ throw er;
}).end();
}
});
process.on('exit', function() {
assert.ok(gotRequest);
- assert.equal(errorCount, 1);
});
requestCert: true
};
var requestCount = 0;
- var errorCount = 0;
var session;
var server = tls.createServer(options, function(cleartext) {
- cleartext.on('error', function() {
- errorCount++;
+ cleartext.on('error', function(er) {
+ // We're ok with getting ECONNRESET in this test, but it's
+ // timing-dependent, and thus unreliable. Any other errors
+ // are just failures, though.
+ if (er.code !== 'ECONNRESET')
+ throw er;
});
++requestCount;
cleartext.end();
// initial request + reconnect requests (5 times)
assert.equal(requestCount, 6);
- assert.equal(errorCount, 4);
});
}