]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19665: Increased timeout for SMTPHandler test.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Tue, 3 Dec 2013 11:28:55 +0000 (11:28 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Tue, 3 Dec 2013 11:28:55 +0000 (11:28 +0000)
Lib/test/test_logging.py

index ae4ca184442c67bc8ca919ec341a1d6dbc09a84f..8c6e6b81167c15b78e86e77bb00b8c0e7d3de33a 100644 (file)
@@ -959,19 +959,21 @@ if threading:
 
 @unittest.skipUnless(threading, 'Threading required for this test.')
 class SMTPHandlerTest(BaseTest):
+    TIMEOUT = 8.0
     def test_basic(self):
         sockmap = {}
         server = TestSMTPServer(('localhost', 0), self.process_message, 0.001,
                                 sockmap)
         server.start()
         addr = ('localhost', server.port)
-        h = logging.handlers.SMTPHandler(addr, 'me', 'you', 'Log', timeout=5.0)
+        h = logging.handlers.SMTPHandler(addr, 'me', 'you', 'Log',
+                                         timeout=self.TIMEOUT)
         self.assertEqual(h.toaddrs, ['you'])
         self.messages = []
         r = logging.makeLogRecord({'msg': 'Hello'})
         self.handled = threading.Event()
         h.handle(r)
-        self.handled.wait(5.0)  # 14314: don't wait forever
+        self.handled.wait(self.TIMEOUT)  # 14314: don't wait forever
         server.stop()
         self.assertTrue(self.handled.is_set())
         self.assertEqual(len(self.messages), 1)