mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -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');
|
||||
}
|
||||
}
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user