-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: fix unreliable test-fs-stat-bigint #21949
Conversation
Remove side-effects between testcases by creating a new file everytime. Fixes: nodejs#21948
test/parallel/test-fs-stat-bigint.js
Outdated
} | ||
|
||
function linkToFile(filename) { | ||
const link = path.join(tmpdir.path, `symbolic-link-${testIndex}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this maybe also increment the index?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That wouldn't hurt but also isn't necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe another fun option might be to change it from:
`symbolic-link-${testIndex}`
...to:
`${filename}-link`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...which might make the whole function unnecessary? All calls to the function could be replaced with:
fs.symlinkSync(filename, `${filename}-link`);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorporated the changes you suggested. I still have the link
variable in there to keep the line width under limit.
@samarthgulati Congratulations on your first PR to Node.js core! 🎉 |
Remove side-effects between testcases by creating a new file everytime. Fixes: nodejs#21948 PR-URL: nodejs#21949 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Landed in 4d94bb2. Thanks for the contribution! 🎉 (If you're interested in other possible contributions to Node.js but don't have a good idea of where to start looking, come ideas are posted at https://www.nodetodo.org/next-steps/.) |
Remove side-effects between testcases by creating a new file everytime. Fixes: #21948 PR-URL: #21949 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Remove side-effects between testcases by creating a new file everytime.
Fixes: #21948
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes