[issue11812] transient socket failure to connect to 'localhost'

Jesús Cea Avión report at bugs.python.org
Tue Nov 8 13:42:04 CET 2011


Jesús Cea Avión <jcea at jcea.es> added the comment:

Antoine:

Deleting the socket timeout doesn't hang the test if we set the thread to "daemon" and do not do a thread.join() (unneeded in the normal situation, since garbage collecting the test instance will collect the thread too). If you don't like this, I can do a fake connection in teardown (look the proposed changeset). The problem with that is OS port reuse. Quite safe, but only "quite".

If thread.join had a timeout , we could wait for a while and if the thread is still active, do a fake connection and another join. A bit overkill for a test, I guess :-).

I stand corrected about getsockname(). I am neutral to it, although we are still involving DNS. I would rather prefer a direct "127.0.0.1".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11812>
_______________________________________


More information about the Python-bugs-list mailing list