Skip to content

Commit 684dd9d

Browse files
Jungku LeeRafaelGSS
Jungku Lee
authored andcommitted
test: fix inconsistency write size in test-fs-readfile-tostring-fail
PR-URL: #51141 Refs: #51133 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
1 parent df31c81 commit 684dd9d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/pummel/test-fs-readfile-tostring-fail.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ const assert = require('assert');
99
const fs = require('fs');
1010
const cp = require('child_process');
1111
const kStringMaxLength = require('buffer').constants.MAX_STRING_LENGTH;
12+
const size = Math.floor(kStringMaxLength / 200);
13+
1214
if (common.isAIX && (Number(cp.execSync('ulimit -f')) * 512) < kStringMaxLength)
1315
common.skip('intensive toString tests due to file size confinements');
1416

1517
const tmpdir = require('../common/tmpdir');
1618
tmpdir.refresh();
1719

18-
if (!tmpdir.hasEnoughSpace(kStringMaxLength)) {
20+
if (!tmpdir.hasEnoughSpace(kStringMaxLength + size)) {
1921
common.skip(`Not enough space in ${tmpdir.path}`);
2022
}
2123

@@ -26,7 +28,6 @@ const stream = fs.createWriteStream(file, {
2628

2729
stream.on('error', (err) => { throw err; });
2830

29-
const size = kStringMaxLength / 200;
3031
const a = Buffer.alloc(size, 'a');
3132
let expectedSize = 0;
3233

0 commit comments

Comments
 (0)