test: http-destroyed-socket-write win32 may ABORT

On windows you can see ECONNABORTED instead of ECONNRESET in various
scenarios, and they are both applicable we're testing that Node is not
swallowing these errors which it was known to do prior to 0.10
This commit is contained in:
Timothy J Fontaine 2014-05-06 10:45:20 -07:00
parent 82fca9136d
commit 41d8e10f0d

View File

@ -61,7 +61,18 @@ server.listen(common.PORT, function() {
req.on('error', function(er) { req.on('error', function(er) {
assert(!gotError); assert(!gotError);
gotError = true; gotError = true;
assert(er.code === 'ECONNRESET', 'Expected ECONNRESET, got ' + er.code + ' ' + er.syscall); switch (er.code) {
// This is the expected case
case 'ECONNRESET':
// On windows this sometimes manifests as ECONNABORTED
case 'ECONNABORTED':
break;
default:
assert.strictEqual(er.code,
'ECONNRESET',
'Writing to a torn down client should RESET or ABORT');
break;
}
clearTimeout(timer); clearTimeout(timer);
console.log('ECONNRESET was raised after %d writes', writes); console.log('ECONNRESET was raised after %d writes', writes);
test(); test();