[Python-checkins] bpo-34092, test_logging: increase SMTPHandlerTest timeout (GH-8245) (GH-8249)

Victor Stinner webhook-mailer at python.org
Wed Jul 11 07:14:40 EDT 2018


https://github.com/python/cpython/commit/d68cb9d62c3671dd9aee5cdecb02fcb3268dacf0
commit: d68cb9d62c3671dd9aee5cdecb02fcb3268dacf0
branch: 3.6
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2018-07-11T13:14:36+02:00
summary:

bpo-34092, test_logging: increase SMTPHandlerTest timeout (GH-8245) (GH-8249)

Change test_logging.SMTPHandlerTest timeout from 8 seconds to 1
minute. The test failed randomly on the slow x86 Gentoo Refleaks 3.7
buildbot.

(cherry picked from commit 31b50b8cbfbf49d5fc17c612cf0dfaa4d0c24983)

files:
M Lib/test/test_logging.py

diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 36d88ac63781..763a5d1df0e3 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -959,7 +959,9 @@ class TestUnixDatagramServer(TestUDPServer):
 
 @unittest.skipUnless(threading, 'Threading required for this test.')
 class SMTPHandlerTest(BaseTest):
-    TIMEOUT = 8.0
+    # bpo-14314, bpo-19665, bpo-34092: don't wait forever, timeout of 1 minute
+    TIMEOUT = 60.0
+
     def test_basic(self):
         sockmap = {}
         server = TestSMTPServer((support.HOST, 0), self.process_message, 0.001,
@@ -973,7 +975,7 @@ def test_basic(self):
         r = logging.makeLogRecord({'msg': 'Hello \u2713'})
         self.handled = threading.Event()
         h.handle(r)
-        self.handled.wait(self.TIMEOUT)  # 14314: don't wait forever
+        self.handled.wait(self.TIMEOUT)
         server.stop()
         self.assertTrue(self.handled.is_set())
         self.assertEqual(len(self.messages), 1)



More information about the Python-checkins mailing list