test: skip test-buffer-tostring-rangeerror when low on memory

This has shown up as RangeError: Array buffer allocation failed and
it should be totally fine to skip this test in case the memory is low.

PR-URL: https://github.com/nodejs/node/pull/58142
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Ruben Bridgewater 2025-05-07 18:28:20 +02:00 committed by GitHub
parent 0050addb1f
commit 5f252a45bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,10 +1,15 @@
'use strict';
require('../common');
const common = require('../common');
// This test ensures that Node.js throws an Error when trying to convert a
// large buffer into a string.
// Regression test for https://github.com/nodejs/node/issues/649.
if (!common.enoughTestMem) {
common.skip('skipped due to memory requirements');
}
const assert = require('assert');
const {
Buffer,