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 <rafael.nunu@hotmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
This commit is contained in:
Michaël Zasso
2023-11-07 12:11:53 +00:00
parent 1528846ada
commit 2341805eb2
2 changed files with 0 additions and 32 deletions

View File

@@ -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');
}
}

View File

@@ -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 = {