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 <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
  • Loading branch information
AdamMajer authored and targos committed Jun 1, 2024
1 parent c1b3e0e commit a371dea
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 a371dea

Please sign in to comment.