Skip to content

test: fix inconsistency write size in test-fs-readfile-tostring-fail - #51141

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
pluris:fix/test_fs_readfile
Dec 25, 2023
Merged

test: fix inconsistency write size in test-fs-readfile-tostring-fail#51141
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
pluris:fix/test_fs_readfile

Conversation

@pluris

@plurispluris commented Dec 13, 2023

Copy link
Copy Markdown
Contributor

In this test, more space is being used than the space being checked.
It's actually using more capacity in stream.write() than is written to kStringMaxLength.
There are 201 buffers used in the for loop.

Even if this code is fixed, I'm not sure if the unstable tests are resolved.

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

constsize=kStringMaxLength/200;
consta=Buffer.alloc(size,'a');
letexpectedSize=0;
for(leti=0;i<201;i++){
stream.write(a,(err)=>{assert.ifError(err);});
expectedSize+=a.length;
}

Refs: #51133

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Dec 13, 2023
@plurispluris changed the title test: fix inconsistency in write size for `test-fs-readfile-tostring-…test: fix inconsistency in write size for test-fs-readfile-tostring-failDec 13, 2023
@pluris
plurisforce-pushed the fix/test_fs_readfile branch from d90fc7d to adecf4dCompareDecember 13, 2023 06:06
@plurispluris changed the title test: fix inconsistency in write size for test-fs-readfile-tostring-failtest: fix inconsistency write size for test-fs-readfile-tostring-failDec 13, 2023
@pluris
plurisforce-pushed the fix/test_fs_readfile branch from adecf4d to 7c5a47cCompareDecember 13, 2023 06:12
@plurispluris changed the title test: fix inconsistency write size for test-fs-readfile-tostring-failtest: fix inconsistency write size in test-fs-readfile-tostring-failDec 13, 2023
@plurispluris closed this Dec 13, 2023
@plurispluris reopened this Dec 13, 2023
@pluris
plurisforce-pushed the fix/test_fs_readfile branch 2 times, most recently from 1499cb9 to be0fb37CompareDecember 13, 2023 08:26
const fs = require('fs');
const cp = require('child_process');
const kStringMaxLength = require('buffer').constants.MAX_STRING_LENGTH;
const size = kStringMaxLength / 200;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
constsize=kStringMaxLength/200;
constsize=Math.floor(kStringMaxLength/200);

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review. I fixed it. 😄

@lpincalpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 14, 2023
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 14, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@lpincalpinca added the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 24, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 24, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/51141
✔ Done loading data for nodejs/node/pull/51141
----------------------------------- PR info ------------------------------------
Title test: fix inconsistency write size in `test-fs-readfile-tostring-fail` (#51141)
Author Jungku Lee (@pluris)
Branch pluris:fix/test_fs_readfile -> nodejs:main
Labels test, needs-ci
Commits 2
- test: fix inconsistency write size in `test-fs-readfile-tostring-fail`
- fixup! test: fix inconsistency write size in test-fs-readfile-tostrin…
Committers 1
- pluris PR-URL: https://github.com/nodejs/node/pull/51141
Refs: https://github.com/nodejs/node/issues/51133
Reviewed-By: Luigi Pinca ------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/51141
Refs: https://github.com/nodejs/node/issues/51133
Reviewed-By: Luigi Pinca --------------------------------------------------------------------------------
⚠ Commits were pushed since the last approving review:
⚠ - fixup! test: fix inconsistency write size in test-fs-readfile-tostrin…
ℹ This PR was created on Wed, 13 Dec 2023 06:03:46 GMT
✔ Approvals: 1
✔ - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/51141#pullrequestreview-1780419297
✔ Last GitHub CI successful
ℹ Last Full PR CI on 2023-12-14T20:38:30Z: https://ci.nodejs.org/job/node-test-pull-request/56294/
- Querying data for job/node-test-pull-request/56294/
✔ Last Jenkins CI successful
--------------------------------------------------------------------------------
✔ Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/7316742704

@nodejs-github-botnodejs-github-bot added the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Dec 24, 2023
@deokjinkimdeokjinkim added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Dec 25, 2023
@deokjinkimdeokjinkim added commit-queue Add this label to land a pull request using GitHub Actions. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Dec 25, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 25, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 26d39e8 into nodejs:mainDec 25, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 26d39e8

RafaelGSS pushed a commit that referenced this pull request Jan 2, 2024
PR-URL: #51141
Refs: #51133
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
@RafaelGSSRafaelGSS mentioned this pull request Jan 2, 2024
richardlau pushed a commit that referenced this pull request Mar 25, 2024
PR-URL: #51141
Refs: #51133
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
@richardlaurichardlau mentioned this pull request Mar 25, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.needs-ciPRs that need a full CI run.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@pluris@nodejs-github-bot@lpinca@deokjinkim