Skip to content

Commit e1ebca0

Browse files
committed
tests: improve streaming test robustness
1 parent f0dfda8 commit e1ebca0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/FakeServer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,12 @@ FakeConnection.prototype._writePacketStream = function _writePacketStream(count)
386386
var writer = new PacketWriter();
387387
writer.writeLengthCodedString(num);
388388
writer.writeLengthCodedString('Row #' + num);
389-
this._socket.write(writer.toBuffer(this._parser));
389+
390+
try {
391+
this._socket.write(writer.toBuffer(this._parser));
392+
} catch (e) {
393+
cleanup.call(this);
394+
}
390395
}
391396
};
392397

0 commit comments

Comments
 (0)