diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-05-23 20:37:54 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-05-23 20:37:54 (GMT) |
commit | ba980db797892e771e9d66e9bd0468cdd2c73115 (patch) | |
tree | bc02e01347095a3009d64b436b0397e17dd78d99 /Lib/test/test_logging.py | |
parent | 1dc540702072c381c3e7570f075a3f1147353d92 (diff) | |
download | cpython-ba980db797892e771e9d66e9bd0468cdd2c73115.zip cpython-ba980db797892e771e9d66e9bd0468cdd2c73115.tar.gz cpython-ba980db797892e771e9d66e9bd0468cdd2c73115.tar.bz2 |
Issue #12151: Added diagnostics to help diagnose intermittent socket errors.
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r-- | Lib/test/test_logging.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 3118065..6c66ff1 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -893,14 +893,29 @@ if threading: def handle(self): self.server._handler(self) + + def finish(self): + data = self.wfile.getvalue() + try: + super(DelegatingUDPRequestHandler, self).finish() + except socket.error: + msg = ('Error during finish, while sending %r, ' + 'closed = %s') + print(msg % (data, self._closed), file=sys.stderr) + raise + ThreadingUDPServer.__init__(self, addr, DelegatingUDPRequestHandler, bind_and_activate) ControlMixin.__init__(self, handler, poll_interval) + self._closed = False def server_bind(self): super(TestUDPServer, self).server_bind() self.port = self.socket.getsockname()[1] + def server_close(self): + super(TestUDPServer, self).server_close() + self._closed = True # - end of server_helper section |