Skip to content

Commit 7fbb376

Browse files
committed
skips the test if there is no space
1 parent 77f5e86 commit 7fbb376

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/parallel/test-fs-promises-file-handle-readFile.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ const tick = require('../common/tick');
1919
const assert = require('node:assert');
2020
const tmpDir = tmpdir.path;
2121

22+
const skipMessage = 'intensive toString tests due to memory confinements';
23+
if (!common.enoughTestMem)
24+
common.skip(skipMessage);
25+
2226
tmpdir.refresh();
2327

2428
async function validateReadFile() {
@@ -40,6 +44,11 @@ async function validateLargeFileSupport() {
4044
const LARGE_FILE_SIZE = 2147483647 + 10 * 1024 * 1024; // INT32_MAX + 10 MB
4145
const FILE_PATH = path.join(os.tmpdir(), 'large-virtual-file.bin');
4246

47+
if (!tmpDir.hasEnoughSpace(LARGE_FILE_SIZE)) {
48+
common.printSkipMessage(`Not enough space in ${os.tmpdir()}`);
49+
return;
50+
}
51+
4352
function createVirtualLargeFile() {
4453
return Buffer.alloc(LARGE_FILE_SIZE, 'A');
4554
}

0 commit comments

Comments
 (0)