From 2341805eb28cfb1326fa6edf3a25c7e77be63c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 7 Nov 2023 12:11:53 +0000 Subject: [PATCH] test: remove tests that create very large buffers With V8 11.9, the maximum ArrayBuffer length can be as high as 2**53, which is a bit too large for current hardware. PR-URL: https://github.com/nodejs/node/pull/50115 Reviewed-By: Rafael Gonzaga Reviewed-By: Michael Dawson --- test/parallel/test-blob-buffer-too-large.js | 24 --------------------- test/parallel/test-buffer-slow.js | 8 ------- 2 files changed, 32 deletions(-) delete mode 100644 test/parallel/test-blob-buffer-too-large.js diff --git a/test/parallel/test-blob-buffer-too-large.js b/test/parallel/test-blob-buffer-too-large.js deleted file mode 100644 index a9cf53b025bbff..00000000000000 --- a/test/parallel/test-blob-buffer-too-large.js +++ /dev/null @@ -1,24 +0,0 @@ -// Flags: --no-warnings -'use strict'; - -const common = require('../common'); -const assert = require('assert'); -const { Blob, kMaxLength } = require('buffer'); - -if (common.isFreeBSD) - common.skip('Oversized buffer make the FreeBSD CI runner crash'); - -try { - new Blob([new Uint8Array(kMaxLength), [1]]); -} catch (e) { - if ( - e.message === 'Array buffer allocation failed' || - e.message === `Invalid typed array length: ${kMaxLength}` - ) { - common.skip( - 'Insufficient memory on this platform for oversized buffer test.' - ); - } else { - assert.strictEqual(e.code, 'ERR_BUFFER_TOO_LARGE'); - } -} diff --git a/test/parallel/test-buffer-slow.js b/test/parallel/test-buffer-slow.js index 58188a43bed021..07138d5db0b397 100644 --- a/test/parallel/test-buffer-slow.js +++ b/test/parallel/test-buffer-slow.js @@ -30,14 +30,6 @@ for (const [key, value] of sb.entries()) { // Should work with edge cases assert.strictEqual(SlowBuffer(0).length, 0); -try { - assert.strictEqual( - SlowBuffer(buffer.kMaxLength).length, buffer.kMaxLength); -} catch (e) { - // Don't match on message as it is from the JavaScript engine. V8 and - // ChakraCore provide different messages. - assert.strictEqual(e.name, 'RangeError'); -} // Should throw with invalid length type const bufferInvalidTypeMsg = {