summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/tests
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2016-12-07 10:09:58 -0500
committerOz Linden <oz@lindenlab.com>2016-12-07 10:09:58 -0500
commit232c3598547913ca6cb66593059497b413a9322c (patch)
treef83fc166648e988bacfeb4cc9dc856226fc8f7a0 /indra/llcorehttp/tests
parent86bd3ffa47c9c19ad1dda726930997ed39f57006 (diff)
parent0532e298a0550c70ca7d94992922d5c040e21702 (diff)
merge nats even newer fix for the llcorehttp test
Diffstat (limited to 'indra/llcorehttp/tests')
-rw-r--r--indra/llcorehttp/tests/test_httprequest.hpp4
-rwxr-xr-xindra/llcorehttp/tests/test_llcorehttp_peer.py19
2 files changed, 7 insertions, 16 deletions
diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp
index a51b1fd32d..463e55dd7e 100644
--- a/indra/llcorehttp/tests/test_httprequest.hpp
+++ b/indra/llcorehttp/tests/test_httprequest.hpp
@@ -1509,10 +1509,6 @@ void HttpRequestTestObjectType::test<14>()
ensure("Request executed in reasonable time", count < limit);
ensure("One handler invocation for request", mHandlerCalls == 1);
-#if LL_WINDOWS
- skip("This test causes our dummy server test_llcorehttp_peer.py to fail");
-#endif
-
// Okay, request a shutdown of the servicing thread
mStatus = HttpStatus();
handle = req->requestStopThread(handlerp);
diff --git a/indra/llcorehttp/tests/test_llcorehttp_peer.py b/indra/llcorehttp/tests/test_llcorehttp_peer.py
index 4dfb60bddb..aad3d4b7b3 100755
--- a/indra/llcorehttp/tests/test_llcorehttp_peer.py
+++ b/indra/llcorehttp/tests/test_llcorehttp_peer.py
@@ -48,7 +48,7 @@ from llbase import llsd
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir,
"llmessage", "tests"))
-from testrunner import freeport, run, debug, VERBOSE
+from testrunner import run, debug, VERBOSE
class TestHTTPRequestHandler(BaseHTTPRequestHandler):
"""This subclass of BaseHTTPRequestHandler is to receive and echo
@@ -303,22 +303,17 @@ if __name__ == "__main__":
if option == "-V" or option == "--valgrind":
do_valgrind = True
- # 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: Server(('127.0.0.1', port), TestHTTPRequestHandler))
+ # Instantiate a Server(TestHTTPRequestHandler) on a port chosen by the
+ # runtime.
+ httpd = Server(('127.0.0.1', 0), 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
# performed in TUT code rather than our own.
- os.environ["LL_TEST_PORT"] = str(port)
- debug("$LL_TEST_PORT = %s", port)
+ os.environ["LL_TEST_PORT"] = str(httpd.server_port)
+ debug("$LL_TEST_PORT = %s", httpd.server_port)
if do_valgrind:
args = ["valgrind", "--log-file=./valgrind.log"] + args
path_search = True
- sys.exit(run(server=Thread(name="httpd", target=httpd.serve_forever), use_path=path_search, *args))
-
+ sys.exit(run(server_inst=httpd, use_path=path_search, *args))