diff options
author | Logan Dethrow <log@lindenlab.com> | 2011-07-12 13:59:26 -0400 |
---|---|---|
committer | Logan Dethrow <log@lindenlab.com> | 2011-07-12 13:59:26 -0400 |
commit | b750a5afb7833d91aed88d9d1f75ee0b4bc2aa80 (patch) | |
tree | ee54bbaed8f2f6016915cd3bb0506805e33179aa /indra/llmessage/tests/test_llsdmessage_peer.py | |
parent | 543943279894d76662833c3b4e35efd7d09a91fc (diff) | |
parent | 44c7c6feaa824f4049d326965cb066e76ebefee3 (diff) |
merge
Diffstat (limited to 'indra/llmessage/tests/test_llsdmessage_peer.py')
-rw-r--r-- | indra/llmessage/tests/test_llsdmessage_peer.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/llmessage/tests/test_llsdmessage_peer.py b/indra/llmessage/tests/test_llsdmessage_peer.py index 9886d49ccc..22edd9dad8 100644 --- a/indra/llmessage/tests/test_llsdmessage_peer.py +++ b/indra/llmessage/tests/test_llsdmessage_peer.py @@ -124,14 +124,19 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): # Suppress error output as well pass +class Server(HTTPServer): + # This pernicious flag is on by default in HTTPServer. But proper + # operation of freeport() absolutely depends on it being off. + allow_reuse_address = False + if __name__ == "__main__": - # Instantiate an HTTPServer(TestHTTPRequestHandler) on the first free port + # Instantiate a Server(TestHTTPRequestHandler) on the first free port # in the specified port range. Doing this inline is better than in a # daemon thread: if it blows up here, we'll get a traceback. If it blew up # in some other thread, the traceback would get eaten and we'd run the # subject test program anyway. httpd, port = freeport(xrange(8000, 8020), - lambda port: HTTPServer(('127.0.0.1', port), TestHTTPRequestHandler)) + lambda port: Server(('127.0.0.1', port), TestHTTPRequestHandler)) # Pass the selected port number to the subject test program via the # environment. We don't want to impose requirements on the test program's # command-line parsing -- and anyway, for C++ integration tests, that's |