From 5f252a45bc4db17b1ba41a747a2dc1a63ed7dbae Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Wed, 7 May 2025 18:28:20 +0200 Subject: [PATCH] test: skip test-buffer-tostring-rangeerror when low on memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Michaƫl Zasso Reviewed-By: LiviaMedeiros Reviewed-By: Stefan Stojanovic Reviewed-By: James M Snell --- test/parallel/test-buffer-tostring-rangeerror.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-buffer-tostring-rangeerror.js b/test/parallel/test-buffer-tostring-rangeerror.js index 4b9357d85c6..a5591213cf2 100644 --- a/test/parallel/test-buffer-tostring-rangeerror.js +++ b/test/parallel/test-buffer-tostring-rangeerror.js @@ -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,