From 4aae3e8eb4e6872b62e15b721ee7f6c34b80d3c8 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 6 Dec 2016 16:07:05 -0500 Subject: DRTVWR-418: Try harder to ignore errors in llcorehttp's dummy server. --- indra/llcorehttp/tests/test_llcorehttp_peer.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/tests/test_llcorehttp_peer.py b/indra/llcorehttp/tests/test_llcorehttp_peer.py index caa204b519..b91cd6bcb4 100755 --- a/indra/llcorehttp/tests/test_llcorehttp_peer.py +++ b/indra/llcorehttp/tests/test_llcorehttp_peer.py @@ -284,10 +284,16 @@ class Server(HTTPServer): # default behavior which *shouldn't* cause the program to return # a failure status. def handle_error(self, request, client_address): - print '-'*40 - print 'Ignoring exception during processing of request from', - print client_address - print '-'*40 + print >>sys.stderr, '-'*40 + print >>sys.stderr, 'Ignoring exception during processing of request from', client_address + print >>sys.stderr, '-'*40 + + def shutdown_request(self, *args, **kwds): + try: + # just forward to base-class method, but wrap in try/except + HTTPServer.shutdown_request(*args, **kwds) + except Exception as err: + print >>sys.stderr, "Once more ignoring: %s" % err if __name__ == "__main__": do_valgrind = False -- cgit v1.2.3 From 40b1913af318f58f2a56e4bf4049437748405033 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 6 Dec 2016 16:20:43 -0500 Subject: DRTVWR-418: Fix minor error in forwarding shutdown_request() call. --- indra/llcorehttp/tests/test_llcorehttp_peer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/tests/test_llcorehttp_peer.py b/indra/llcorehttp/tests/test_llcorehttp_peer.py index b91cd6bcb4..4dfb60bddb 100755 --- a/indra/llcorehttp/tests/test_llcorehttp_peer.py +++ b/indra/llcorehttp/tests/test_llcorehttp_peer.py @@ -291,7 +291,7 @@ class Server(HTTPServer): def shutdown_request(self, *args, **kwds): try: # just forward to base-class method, but wrap in try/except - HTTPServer.shutdown_request(*args, **kwds) + HTTPServer.shutdown_request(self, *args, **kwds) except Exception as err: print >>sys.stderr, "Once more ignoring: %s" % err -- cgit v1.2.3