-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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 flaky tls-inception #5450
Conversation
test/parallel/test-tls-inception.js
Outdated
}); | ||
|
||
socket.on('error', function(err) { | ||
console.error(err); |
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 check that the error is ECONNRESET
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 seems reasonable to me
@santigimeno removing the destination listener doesn't seem to cause any problems on Ubuntu 14.04, but without the error handler I'm still getting the ECONNRESET errors on Win7. |
@gibm Yes, I was only talking about removing the |
@santigimeno Yep, just running the test to make sure it's all working, then I'll update this. |
9ee1087
to
3030806
Compare
PR updated as per @santigimeno 's suggestions. Let me know if there's anything else that would be worth adding. |
3030806
to
120cb2a
Compare
test/parallel/test-tls-inception.js
Outdated
socket.on('error', function(err) { | ||
console.error(err); | ||
if (err.code !== 'ECONNRESET') | ||
throw err; |
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 restricting the error handling to windows as in https://github.com/nodejs/node/blob/master/test/parallel/test-child-process-fork-regr-gh-2847.js#L18-L23
Also, probably we can remove the console.error
as the error info will be available if the exception is thrown
A couple of comments, but LGTM |
120cb2a
to
0a299b5
Compare
@santigimeno updated, tests still looking good. |
Seems like it would be good to have an expert look over even small changes to tls tests. So... /cc @nodejs/crypto |
Bump! If anyone else has any problems or suggestions let me know... |
@jasnell I'm afraid that I don't have Windows to check this PR now. It was crashed several months ago and needs several days to get restored. |
Is it possible to run the node-test-commit-windows job for this change? |
0a299b5
to
60fccc6
Compare
So looking at the test results, it looks like this change causes the test to fail on OSX and SmartOS with ECONNRESET. I can replicate this (at least for OSX) myself. It looks like the test failure is due to the removal of the |
60fccc6
to
cf17a69
Compare
The test now catches ECONNRESET errors thrown in parallel/test-tls-inception on windows.
cf17a69
to
9f20d29
Compare
Okay, this is interesting. This works on OSX and fails on Windows with dest.on('end', function() {
socket.destroy();
}); This works on Windows and fails on OSX (and possibly SmartOS) with dest.on('end', function() {
socket.end();
}); Removing this listener entirely also works on Windows (but not OSX). @santigimeno would you have any ideas about why? |
@gibm IIRC, the problem I tried to fix in 3b94991 was that sometimes, in |
@santigimeno okay, that makes sense. So we can:
I don't really know enough about this test to have an opinion on which is better. I'm happy to look at this in more depth, but if anyone else has any more information that'd be helpful. @indutny I noticed you originally added this handler, do you have any opinions on this? |
What's the status on this one? |
@jasnell I think it's on hold until someone with more knowledge of this test can take a look, or I get time to go through and decide what makes most sense. I think it will be one of the options I mentioned above. |
/cc @Trott |
/cc @nodejs/platform-windows |
|
@Trott which change looks good to you? Handling the EADDRINUSE in Windows The PR as-is now fails on OSX and SmartOS. |
@gibm Never mind, I misunderstood the state of affairs. Sorry for the noise. |
Ping @nodejs/platform-windows @nodejs/testing |
Is the difference in behavior on the different platforms just The Way It Is On Those Platforms? Or is it an issue in Node.js (or one of its dependencies like libuv)? Or is that not known at this point? We certainly have plenty of instances of tests where we check if it's Windows and do one thing, otherwise do something else. So we could go that route here, if people are pretty sure the issue is necessarily different behavior on the different platforms and isn't a bug in Node itself. /cc @nodejs/crypto |
7da4fd4
to
c7066fb
Compare
one more ping to @nodejs/crypto and @nodejs/platform-windows |
I haven't been able to continue to investigate this one yet, but it's still in my queue. The best course of action here would be to fix this test with whatever hack it need to test what it's meant to test: the TLS inception, the real goal of the test seems to be the assert at https://github.com/nodejs/node/blob/cdcfeb7/test/parallel/test-tls-inception.js#L64 . However, if I'm not missing anything, none of the |
Disregarding the test-on-Windows part of this, can someone in @nodejs/crypto look at this change to this test and comment on whether the change is sensible in that the test still checks that Node.js is behaving correctly? Or does the change here merely cover up buggy behavior and the test should be failing? (And if it's covering up buggy behavior, any opinion as to if it is likely to be a bug in Node.js, libuv, Windows, something else?) |
@joaocgreis Unfortunately, I don't think we can copy this over to |
c133999
to
83c7a88
Compare
Ping @gibfahn ... status on this one? |
To be honest I was shooting in the dark with this one, if someone from @nodejs/platform-windows (maybe @digitalinfinity) could confirm that this makes sense then we can go ahead with this (or not...) |
I've been hesitant on this one because I think there's a deeper issue here. At the very least we have a platform discrepancy. The test is testing what it's supposed to test, so I'm +1 with working around the error here (perhaps we should open another issue about the test failing as is now, even without the @gibfahn this PR is changing |
@joaocgreis Looking at the original issue (#5386) it looks like the I don't think this should land as is, it's really just covering up an existing issue. If we think the test is exposing a real node issue on windows, we shouldn't just try to ignore errors and pretend that everything's fine. |
@gibfahn is it OK to close this if you say it shouldn't land as is? |
@fhinkel yep, I'll close. |
PR to address #5386 .
Affected core subsystem(s)
test
Description of change
The test now catches ECONNRESET errors thrown in parallel/test-tls-inception on windows. It also
replacesremovessocket.destroy()
withassocket.end()
,socket.destroy()
also seemed to be causing occasional failures on windows.