-
-
Notifications
You must be signed in to change notification settings - Fork 545
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
Fixes issues where Node doesn't error if port is in use. #207
base: master
Are you sure you want to change the base?
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.
Thanks! I was just reading your issue about this. I guess a refactor at some point broke it. So it doesn't happen again, can you add a test for both of these things?
For example, there should be at least one test that doesn't pass if I put the .listen line back above the .on calls and at lest one test that does not pass if I remove the 0.0.0.0 argument.
As a side note, won't the 0.0.0.0 change be a breaking semver major change? Looking at the Node.js docs without that it will listen on both IPv4 and IPv6 but with the 0.0.0.0 it will only listen on IPv4, right? If so, is there a way to keep it listening on both?
Working on a solution now. I'm going to update this PR to better describe what is happening and how the fix would solve that. |
After a lot of research, I have reverted part of my fix and provided a test for it. The issue that I was having is an OS specific issue. If you have IPv6 enabled it will not necessarily block IPv4 for listening. I've added a comment block to explain more what is happening incase other engineers have this issue with their app. I've also added in a catch for an error condition that may return on Linux when kernel option Sources: ipv6only listen/bind option Why listening "::" (all IPv6) also get "0.0.0.0"(all IPv4) listened? IPv6: Is |
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.
Thanks for looking into this! Unfortunately the test is not going to cut it. It's just too fragile and asserts nothing about the program's behavior, only that a specific piece of source code exists. All the tests in this project are invoking through the bin file to start apps, so all the work is there to start the app and capture output. Just needs to be done for this test so it's not coupled to specific source code styling.
I can help out on this in a few weeks if you're not able to get to it as well
Sorry I haven't gotten back to this. I will try to get to this before the end of the month. |
This fixes #206