Skip to content

Commit

Permalink
test: increase allocation so it fails for the test
Browse files Browse the repository at this point in the history
It used to be impossible to allocate 1e10 bytes but with a v8 update
this allocation can succeed. This results in 2x10GB allocations and
failure to test the failure :-)

Increase allocation to 1e20 bytes, which should fail for some time,
returning the test to using only 50MB at runtime.

Fixes: #53085
PR-URL: #53099
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
  • Loading branch information
AdamMajer authored and marco-ippolito committed Jul 19, 2024
1 parent 8f5fb41 commit 0051d1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-buffer-failed-alloc-typed-arrays.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const SlowBuffer = require('buffer').SlowBuffer;
// whether or not to zero-fill was not being reset, causing TypedArrays to
// allocate incorrectly.
const zeroArray = new Uint32Array(10).fill(0);
const sizes = [1e10, 0, 0.1, -1, 'a', undefined, null, NaN];
const sizes = [1e20, 0, 0.1, -1, 'a', undefined, null, NaN];
const allocators = [
Buffer,
SlowBuffer,
Expand Down

0 comments on commit 0051d1c

Please sign in to comment.