From 501546e8f37059cd577041e23941b640d0d4d406 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Fri, 24 May 2024 11:56:03 +0200 Subject: [PATCH] test: increase allocation so it fails for the test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/issues/53085 PR-URL: https://github.com/nodejs/node/pull/53099 Reviewed-By: Luigi Pinca Reviewed-By: Michaƫl Zasso Reviewed-By: Antoine du Hamel Reviewed-By: Richard Lau Reviewed-By: Marco Ippolito Reviewed-By: Mohammed Keyvanzadeh --- test/parallel/test-buffer-failed-alloc-typed-arrays.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-buffer-failed-alloc-typed-arrays.js b/test/parallel/test-buffer-failed-alloc-typed-arrays.js index 3e91b31ccaf6f3..699475ad0a8b31 100644 --- a/test/parallel/test-buffer-failed-alloc-typed-arrays.js +++ b/test/parallel/test-buffer-failed-alloc-typed-arrays.js @@ -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,