Uh oh!
There was an error while loading. Please reload this page.
test: ensure existence of _handle property - #5916
Conversation
drewfish
commented
Mar 26, 2016
Thanks for the mention! Yes we're doing our jenkins builds inside of docker images. I'm running the tests using the (FWIW I've seen another case where node.js was being much more particular about IO streams than other languages.) |
santigimeno
commented
Mar 26, 2016
@Trott is there an issue opened for this? or a way to reproduce it? I have run the test suite on docker from time to time but never saw that error |
Trott
commented
Mar 26, 2016
@santigimeno It's not specific to Docker, although that might be a contributing factor. @bengl asked me about it today and I was able to reproduce the issue by using |
Trott
commented
Mar 26, 2016
Here's what the error looks like without this patch and using |
jbergstroem
commented
Mar 27, 2016
Holy crap; I've been seeing this in gentoo in a sandbox for years but couldn't figure out what was going on. Thanks 👍 https://github.com/gentoo/gentoo/blob/master/net-libs/nodejs/nodejs-5.9.0.ebuild#L71..L76 |
Trott
commented
Mar 27, 2016
Alternate (perhaps better) solution might be to create a child process with an appropriate |
Fishrock123
commented
Mar 27, 2016
I'm pretty sure there is also an actual... API? issue here too. I suppose the question would be, should
node/lib/internal/process/stdio.js Lines 54 to 57 in 293fd04 |
Trott
commented
Mar 27, 2016
OK, I've updated the test so that it doesn't skip if there's no If the current behavior is deemed a bug as @Fishrock123 seems to suggest, then we can put a version of this test in In the meantime, here's a version of the test that should always pass. |
Fishrock123
commented
Mar 28, 2016
I'm not sure if it is a bug so much as a possible API deficiency. I guess you could just write it off as an oddity but that seems pretty ... not-good to me, although I'm not really sure how to fix it either. |
Fishrock123
commented
Mar 28, 2016
I've made a PR for the known issue at #5935 |
Trott
commented
Mar 28, 2016
The single CI failure appears to be known-flaky and unrelated. |
Fishrock123
commented
Mar 28, 2016
lgtm |
Trott
commented
Mar 28, 2016
bengl
commented
Mar 28, 2016
Giving it a go. Back soon with results. |
mhdawson
commented
Mar 28, 2016
Good to see this being fixed. The suse build team for PPC was also seeing this failure and I was working with them to try and figure out why. |
bengl
commented
Mar 28, 2016
Yep. Fixes the test for us. |
drewfish
commented
Mar 28, 2016
@jbergstroem do you happen to have also seen failures of test-cluster-master-error.js and test-cluster-master-kill.js? Given that you saw the test-stdtout-close-unref failure as well I thought I'd see how common these other two are before I dig into them. |
There was a problem hiding this comment.
I suggest doing the following instead:
proc.stderr.pipe(process.stderr);proc.on('exit',common.mustCall(function(exitCode){process.exitCode=exitCode;}));This way, you can see the child's error, and not need to generate a second error on the parent.
... What I'm going to be doing for TTY testing in #5834 :)
There was a problem hiding this comment.
@Fishrock123 Ooh, yes, neat, will do. (I'm going to use process.exit(...) instead of process.exitCode = ... there if it's all the same to you.)
jbergstroem
commented
Mar 30, 2016
@drewfish sorry for the late response -- I swear I replied (this is the second time I've seen this happen; watching you github!). Anyway, haven't seen any issues with those tests from the gentoo sandbox. |
bc85d46 to
b808952CompareTrott
commented
Mar 30, 2016
Whoops, pushed the wrong version, let's try again. Updated, PTAL. |
Trott
commented
Mar 31, 2016
CI is being uncooperative. Let's CI again: https://ci.nodejs.org/job/node-test-pull-request/2105/ |
Trott
commented
Mar 31, 2016
Well, it was more cooperative that time, but still one host hung while building or something. So let's do it again, because hey, I like my CI green: https://ci.nodejs.org/job/node-test-pull-request/2112/ |
Trott
commented
Mar 31, 2016
@Fishrock123 Your LGTM still stands? |
There was a problem hiding this comment.
I would probably make this just set the process.exitCode, rather than exit().
exit() is a bit ... expedited ... and can cause unwanted things. :)
There was a problem hiding this comment.
@Fishrock123 I suppose so. I did that instead of setting process.exitCode because setting the exit code but doing nothing else is kind of magical and also leaves open the possibility of someone adding a test to this file later on that does the same thing, thus overriding the exit code here. I'm probably overthinking it, though. Will switch to your recommendation.
Fishrock123
commented
Mar 31, 2016
lgtm otherwise |
`<`-ing a file into stdin actually results in a `fs.ReadStream`, rather than a `tty.ReadStream`, and as such does not inherit from net.Socket, unlike the other possible stdin options. Refs: nodejs#5916 PR-URL: nodejs#5935 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
`test-stdtout-close-unref.js` will fail if `process.stdin._handle` does not exist. On UNIX-like operating systems, you can see this failure this way: ./node test/parallel/test-stdout-close-unref.js < /dev/null This issue has been experienced by @bengl and @drewfish in a Docker container. I'm not sure why they are experiencing it in their environment, but since it is possible that the `_handle` property does not exist, let's use `child_process.spawn()` to make sure it exists.
Trott
commented
Mar 31, 2016
Updated to use |
Trott
commented
Mar 31, 2016
CI for good measure: https://ci.nodejs.org/job/node-test-pull-request/2116/ |
`test-stdtout-close-unref.js` will fail if `process.stdin._handle` does not exist. On UNIX-like operating systems, you can see this failure this way: ./node test/parallel/test-stdout-close-unref.js < /dev/null This issue has been experienced by @bengl and @drewfish in a Docker container. I'm not sure why they are experiencing it in their environment, but since it is possible that the `_handle` property does not exist, let's use `child_process.spawn()` to make sure it exists. PR-URL: nodejs#5916 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Trott
commented
Apr 1, 2016
Landed in a20c700 |
`test-stdtout-close-unref.js` will fail if `process.stdin._handle` does not exist. On UNIX-like operating systems, you can see this failure this way: ./node test/parallel/test-stdout-close-unref.js < /dev/null This issue has been experienced by @bengl and @drewfish in a Docker container. I'm not sure why they are experiencing it in their environment, but since it is possible that the `_handle` property does not exist, let's use `child_process.spawn()` to make sure it exists. PR-URL: #5916 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
`test-stdtout-close-unref.js` will fail if `process.stdin._handle` does not exist. On UNIX-like operating systems, you can see this failure this way: ./node test/parallel/test-stdout-close-unref.js < /dev/null This issue has been experienced by @bengl and @drewfish in a Docker container. I'm not sure why they are experiencing it in their environment, but since it is possible that the `_handle` property does not exist, let's use `child_process.spawn()` to make sure it exists. PR-URL: #5916 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Pull Request check-list
Please make sure to review and check all of these items:
make -j8 test(UNIX) orvcbuild test nosign(Windows) pass withthis change (including linting)?
test (or a benchmark) included?
existing APIs, or introduces new ones)?
Affected core subsystem(s)
test
Description of change
test-stdtout-close-unref.jswill fail ifprocess.stdin._handledoesnot exist. On UNIX-like operating systems, you can see this failure this
way:
This issue has been experienced by @bengl and @drewfish in a Docker
container. I'm not sure why they are experiencing it in their
environment, but since it is possible that the
_handleproperty doesnot exist, perhaps it should be checked.
@nodejs/testing