1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

Handle very big pipelines without crashing

This commit is contained in:
Ruben Bridgewater
2016-03-01 16:57:32 +01:00
parent cc540dbc3c
commit 89209b8adc
2 changed files with 30 additions and 3 deletions

View File

@@ -70,6 +70,28 @@ describe("The 'multi' method", function () {
});
});
describe('pipeline limit', function () {
it('do not exceed maximum string size', function (done) {
this.timeout(12000); // Windows tests on 0.10 are slow
// Triggers a RangeError: Invalid string length if not handled properly
client = redis.createClient();
var multi = client.multi();
var i = Math.pow(2, 28);
while (i > 0) {
i -= 10230;
multi.set('foo' + i, 'bar' + new Array(1024).join('1234567890'));
}
client.on('ready', function () {
multi.exec(function (err, res) {
assert.strictEqual(res.length, 26241);
});
client.flushdb(done);
});
});
});
helper.allTests(function(parser, ip, args) {
describe("using " + parser + " and " + ip, function () {