okfn/ckan — pull request #543 by domoritz (2013-03-02 18:57:17+00:00)
Title: ckanext.resourceproxy.tests.test_proxy.TestProxyBasic sometimes fail

As @tobes noticed, sometimes that test fail (i.e https://travis-ci.org/okfn/ckan/jobs/5163996). The problems seems to be known, and faced by other projects (https://github.com/EnigmaCurry/blogofile/pull/140 and http://python.6.n6.nabble.com/Address-already-in-use-with-TCPServer-td1520157.html).

It seems to be that, after you destroy a server you created, you still have to wait for a few minutes to recreate it, because the socket is still being used. The solution seems to be to add `allow_reuse_address = True` to the server's class.

@domoritz did it in https://github.com/okfn/ckan/blob/master/ckanext/resourceproxy/tests/file_server.py#L34-L35 a few months ago, but we're still getting the error. Not sure why.

While reading the code, I couldn't find where we stop the server. I don't know if it's a problem or not. @domoritz thoughts?