-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix failing test_net_if_addrs when some network interfaces are disconnected #895
Conversation
…n fail, so skip in that case.
A couple tests failed on AppVeyor due to the issue fixed by #897 |
Can you point me to the failure or provide the traceback? Even if the interface is down the IP addresses should be consistent. If the failure is because the address cannot be binded it's ok (so we skip that), but if the test fails because the address is not a valid IPv4 address or something then we want a failure. |
Ah, to be clear it's simply that the address can't be binded. The error this is fixing look like this:
I can reproduce this very simply outside psutil as well, simply by looping over the IP addresses of the interfaces and trying to bind a socket to them. It fails with this error only on interfaces that are down. |
What the address looks like? Is it valid? On Sep 30, 2016 1:58 PM, "Erik Bray" notifications@github.com wrote:
|
They have link-local addresses. For example:
|
It probably is enough to just skip the |
I think I see what you're saying, but if it just skipped the |
In other words, all this PR changes is skipping the part of the test that creates a socket and binds the address to it. It doesn't skip any other assertions. If it skips the bind there's not much point in creating the socket to bind to. |
I erroneously thought we were also checking address validity but we're not. Sorry about that. Merging. |
Ok, no problem. Thanks! |
Thank you dude. ;) |
Trying to bind a socket to the address of an interface that's down can fail, so skip in that case.