diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2011-07-13 15:02:23 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2011-07-13 15:02:23 -0400 |
commit | ee0e23e77f10a5171899059ff157e8dab29ebd70 (patch) | |
tree | b7fc84c515f7c03d31f48bc9d23d808400853cd4 /indra/llmessage/tests/test_llsdmessage_peer.py | |
parent | f0c7413e46aef65b995c1c48910526be6f27b35d (diff) | |
parent | dd3069127bb437e95d106734e8a0ab95307e297c (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 |