Skip to content

Commit

Permalink
test: fix inconsistency write size in test-fs-readfile-tostring-fail
Browse files Browse the repository at this point in the history
PR-URL: #51141
Refs: #51133
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
  • Loading branch information
Jungku Lee authored and RafaelGSS committed Jan 2, 2024
1 parent df31c81 commit 684dd9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/pummel/test-fs-readfile-tostring-fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ const assert = require('assert');
const fs = require('fs');
const cp = require('child_process');
const kStringMaxLength = require('buffer').constants.MAX_STRING_LENGTH;
const size = Math.floor(kStringMaxLength / 200);

if (common.isAIX && (Number(cp.execSync('ulimit -f')) * 512) < kStringMaxLength)
common.skip('intensive toString tests due to file size confinements');

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

if (!tmpdir.hasEnoughSpace(kStringMaxLength)) {
if (!tmpdir.hasEnoughSpace(kStringMaxLength + size)) {
common.skip(`Not enough space in ${tmpdir.path}`);
}

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

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

const size = kStringMaxLength / 200;
const a = Buffer.alloc(size, 'a');
let expectedSize = 0;

Expand Down

0 comments on commit 684dd9d

Please sign in to comment.