-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
test: extended test to makeCallback cb type check #12140
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
Conversation
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.
s/Thows/Throws/ ?
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.
Doesn't this delete the file? How about using another method that calls makeCallback() like, I don't know, fs.chmod()?
The comment should also be updated.
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.
Good point...but any of the operations which are calling makeCallback have an impact on the file. I would then use fs.mkdtemp which only creates a temp dir which we can delete at the end of the test. Does it make sense to you @lpinca?
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.
Yes works for me.
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.
s/Thows/Throws/ ?
83c8316 to
10a9547
Compare
jasnell
left a comment
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.
LGTM. One suggestion tho: the process.once('warning', ...) bit can be replaced by a call to common.expectWarning(...)
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.
Can you remove this.
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 be os.tmpdir()? Alternatively, there is common.tmpDir for use in tests.
424fcb6 to
21f94d7
Compare
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.
This throws an error if the test is run in isolation node test/parallel/test-fs-make-callback.js and common.tmpDir has not been created.
I think it makes sense to run common.refreshTmpDir() at the beginning of the test.
21f94d7 to
c0b4f0d
Compare
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.
I'd use common.expectWarning() for consistency.
makeCallback and makeStatsCallback are both tested intedependently. Fixes: nodejs#12136
c0b4f0d to
bee1920
Compare
mhdawson
left a comment
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.
LGTM
|
CI is green landing |
|
landed as 53828e8 |
|
Should this be backported to |
|
I'm backporting this with #12270 |
makeCallback and makeStatsCallback are both tested intedependently. PR-URL: #12140 Backport-PR-URL: #13785 Fixes: #12136 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
makeCallback and makeStatsCallback are both tested intedependently. PR-URL: #12140 Backport-PR-URL: #13785 Fixes: #12136 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
makeCallback and makeStatsCallback are both tested intedependently. PR-URL: #12140 Backport-PR-URL: #13785 Fixes: #12136 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
makeCallback and makeStatsCallback are both tested intedependently. PR-URL: nodejs/node#12140 Fixes: nodejs/node#12136 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
makeCallback and makeStatsCallback are both tested intedependently.
Fixes: #12136
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test, fs