-
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
fs: avoid circular dependency in SyncWriteStream #11986
Conversation
so the first CI run failed on some of the windows boxes. Do they not all have |
Windows shell does not support using |
@bzoz could you use a newline instead of |
@gibfahn that would not work also. From the first glance it looks like |
Yeah okay, so @evanlucas looks like the choices are:
const cmd = `echo "${input}" | ${bin} > ${out} 2>&1`;
const cmd2 = `cat ${out}`;
assert.strictEqual(execSync(cmd).toString(), '');
const result = execSync(cmd2).toString();
I assume there's a reason to do the read not through node? Also if you could add a brief comment to the top of the test explaining what it tests that would be really helpful. It's not immediately obvious to me what it checks. |
test/parallel/test-stdin-require.js
Outdated
const path = require('path'); | ||
|
||
common.refreshTmpDir(); | ||
const filename = path.join(__dirname, '..', 'fixtures', 'baz.js'); |
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.
common.fixturesDir
?
Previously, there was a circular dependency on the public fs module in SyncWriteStream. Moving the implementations of fs.writeSync and fs.closeSync to internal/fs allows us to avoid that circular dependency. Fixes: nodejs#11257
20f02cd
to
fdcfe99
Compare
Ok, updated. PTAL
No, there wasn't. This used the same script from the original test case. I switched to just reading the file via node. Thanks for checking me on that :] I also switched to using |
ouch, CI didn't seem to like that much on anything but OS X :[. I'll dig more into this. |
@evanlucas would you mind looking into this again? I think it would be great if we can get this fix in. |
Ping @evanlucas |
I kept running in to trouble getting a test that works across all platforms. I don't really have the time to pick this up right now (I'm about to go on vacation), so if someone else wants to pick up here, fine by me. Otherwise, feel free to close and I'll try to get around to it when I get back. Thanks! |
Ping @nodejs/platform-windows @refack would someone mind to take a look at the windows failures? |
The command for Windows should have extra quotes
That said, this test passes on my Node 8.5.0. Is this PR still needed? |
@bzoz I can not reproduce this either anymore but in the original bug report there is a user that reported this for 8.5 as well. |
I am closing this as it seems to be resolved in v8.6 even though it is not clear what really solved it. |
Previously, there was a circular dependency on the public fs module in
SyncWriteStream. Moving the implementations of fs.writeSync and
fs.closeSync to internal/fs allows us to avoid that circular dependency.
This is an alternative to #11260.
Fixes #11257 (added by @BridgeAR)
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
fs