Skip to content
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

OS X: Tests fail with "Address already in use" errors #36

Open
ulope opened this issue Feb 12, 2016 · 1 comment
Open

OS X: Tests fail with "Address already in use" errors #36

ulope opened this issue Feb 12, 2016 · 1 comment

Comments

@ulope
Copy link
Member

ulope commented Feb 12, 2016

On OS X various tests fail with "Address already in use" errors. The reason is that some tests try to restart an app on the same port in quick succession or use the same port for different but quickly succeeding tests.

In theory this should be no problem because gevent by default configures sockets to SO_REUSEADDR but apparently there is different behaviour between OS X and Linux in this regard.

Example:

______________________________________________________________ test_disconnect _______________________________________________________________

        app_helper.run(ExampleApp, ExampleServiceAppDisconnect,
>                      num_nodes=3, min_peers=2, max_peers=1)

devp2p/tests/test_full_app.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
devp2p/app_helper.py:105: in run
    serve_until_stopped(apps)
devp2p/app_helper.py:59: in serve_until_stopped
    app.start()
devp2p/app.py:37: in start
    service.start()
devp2p/discovery.py:569: in start
    self.server.start()
/Users/ulo/.cache/tox/pydevp2p/py27/lib/python2.7/site-packages/gevent/baseserver.py:280: in start
    self.init_socket()
/Users/ulo/.cache/tox/pydevp2p/py27/lib/python2.7/site-packages/gevent/server.py:145: in init_socket
    self.socket = self.get_listener(self.address, self.family)
/Users/ulo/.cache/tox/pydevp2p/py27/lib/python2.7/site-packages/gevent/server.py:155: in get_listener
    return _udp_socket(address, reuse_addr=self.reuse_addr, family=family)
/Users/ulo/.cache/tox/pydevp2p/py27/lib/python2.7/site-packages/gevent/server.py:197: in _udp_socket
    sock.bind(address)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <socket at 0x1078d1f10 fileno=23 sock=0.0.0.0:0>, args = (('0.0.0.0', 29870),)

>   ???
E   error: [Errno 48] Address already in use: ('0.0.0.0', 29870)
ulope added a commit that referenced this issue Mar 11, 2016
@ulope
Copy link
Member Author

ulope commented Mar 11, 2016

This might have been fixed in 3016cda. If it doesn't reappear we can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant