diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-12-03 12:31:23 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-12-03 12:31:23 (GMT) |
commit | dc96ca25df87ebf3ad0a2f29591f186873d40679 (patch) | |
tree | df37bf950bbb489a54b1900d2ac340f6e8def30d | |
parent | ef2d8a597cf859b9d945dfb1c491a214fb1381df (diff) | |
download | cpython-dc96ca25df87ebf3ad0a2f29591f186873d40679.zip cpython-dc96ca25df87ebf3ad0a2f29591f186873d40679.tar.gz cpython-dc96ca25df87ebf3ad0a2f29591f186873d40679.tar.bz2 |
Added some diagnostics to help with #19690.
-rw-r--r-- | Lib/test/test_logging.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 5702c1c..ce3f84c 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -590,6 +590,7 @@ class HandlerTest(BaseTest): for _ in range(tries): try: os.unlink(fname) + self.deletion_time = time.time() except OSError: pass time.sleep(0.004 * random.randint(0, 4)) @@ -597,6 +598,9 @@ class HandlerTest(BaseTest): del_count = 500 log_count = 500 + self.handle_time = None + self.deletion_time = None + for delay in (False, True): fd, fn = tempfile.mkstemp('.log', 'test_logging-3-') os.close(fd) @@ -610,7 +614,14 @@ class HandlerTest(BaseTest): for _ in range(log_count): time.sleep(0.005) r = logging.makeLogRecord({'msg': 'testing' }) - h.handle(r) + try: + self.handle_time = time.time() + h.handle(r) + except Exception: + print('Deleted at %s, ' + 'opened at %s' % (self.deletion_time, + self.handle_time)) + raise finally: remover.join() h.close() |