diff options
author | Callum Prentice <callum@gmail.com> | 2016-12-07 08:43:51 -0800 |
---|---|---|
committer | Callum Prentice <callum@gmail.com> | 2016-12-07 08:43:51 -0800 |
commit | 70a42af076cbe6f12a265d508b4ed96af65d26ba (patch) | |
tree | b8dd5848d4703f6320eb69c0376c492fa3a16bbb /indra/llcorehttp/tests | |
parent | 15c043ec20eeaa08de21c0aed4e122b5095a98b0 (diff) | |
parent | 232c3598547913ca6cb66593059497b413a9322c (diff) |
Automated merge with tip of lindenlab/oz_viewer64
Diffstat (limited to 'indra/llcorehttp/tests')
-rw-r--r-- | indra/llcorehttp/tests/test_httprequest.hpp | 4 | ||||
-rwxr-xr-x | indra/llcorehttp/tests/test_llcorehttp_peer.py | 19 |
2 files changed, 7 insertions, 16 deletions
diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp index 0aad3d1835..463e55dd7e 100644 --- a/indra/llcorehttp/tests/test_httprequest.hpp +++ b/indra/llcorehttp/tests/test_httprequest.hpp @@ -1455,10 +1455,6 @@ void HttpRequestTestObjectType::test<14>() set_test_name("HttpRequest GET timeout"); -#if LL_WINDOWS - skip("This test causes our dummy server test_llcorehttp_peer.py to fail"); -#endif - // Handler can be stack-allocated *if* there are no dangling // references to it after completion of this method. // Create before memory record as the string copy will bump numbers. 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)) |