★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/194d1955a7Nouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files

test: fix test-tls-connect-memleak

A loop that generates a long array is resulting in a RangeError. Moving
to Array.prototype.fill() along with the ** operator instead of using a
loop fixes the issue.

PR-URL: #21681
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
  • Loading branch information...
Trott authored and targos committed Jul 6, 2018
1 parent cd77d87 commit 194d1955a77d1011368c8802599a0aa5b122ac4d
Showing with 1 addition and 3 deletions.
  1. +1 −3 test/pummel/test-tls-connect-memleak.js
@@ -44,9 +44,7 @@ tls.createServer({

{
// 2**26 == 64M entries
let junk = [0];

for (let i = 0; i < 26; ++i) junk = junk.concat(junk);
const junk = new Array(2 ** 26).fill(0);

const options = { rejectUnauthorized: false };
tls.connect(common.PORT, '127.0.0.1', options, function() {

0 comments on commit 194d195

Please sign in to comment.
You can’t perform that action at this time.