Permalink
Browse files

adjust raw destroy test so it catches errors again

  • Loading branch information...
substack committed Dec 15, 2012
1 parent 72f7f63 commit 742c117545a2f9e97bf8432f7ae96a70341c0acf
Showing with 6 additions and 4 deletions.
  1. +6 −4 test/raw_destroy.js
@@ -4,7 +4,7 @@ var net = require('net');
var EventEmitter = require('events').EventEmitter;
test('destroy the socket during piping', function (t) {
t.plan(2);
t.plan(3);
var p0 = Math.floor(Math.random() * (Math.pow(2,16) - 1e4) + 1e4);
var p1 = Math.floor(Math.random() * (Math.pow(2,16) - 1e4) + 1e4);
@@ -26,14 +26,16 @@ test('destroy the socket during piping', function (t) {
c.write('\r\n');
setTimeout(function () {
// writing to a closed socket shouldn't throw anymore
c.once('error', function (err) {
t.ok(/socket is closed/.test(err.message));
});
c.write('a=3&b=4');
}, 50);
}, 300);
setTimeout(function () {
t.pass();
c.end();
}, 100);
}, 350);
});
});

0 comments on commit 742c117

Please sign in to comment.