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

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 31b50b8cbf)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
This commit is contained in:
Miss Islington (bot) 2018-07-11 06:56:45 -07:00 committed by Victor Stinner
parent 151820e7a0
commit 0a1db32949
1 changed files with 3 additions and 2 deletions

View File

@ -971,7 +971,8 @@ if hasattr(socket, "AF_UNIX"):
# - end of server_helper section # - end of server_helper section
class SMTPHandlerTest(BaseTest): 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): def test_basic(self):
sockmap = {} sockmap = {}
@ -986,7 +987,7 @@ class SMTPHandlerTest(BaseTest):
r = logging.makeLogRecord({'msg': 'Hello \u2713'}) r = logging.makeLogRecord({'msg': 'Hello \u2713'})
self.handled = threading.Event() self.handled = threading.Event()
h.handle(r) h.handle(r)
self.handled.wait(self.TIMEOUT) # 14314: don't wait forever self.handled.wait(self.TIMEOUT)
server.stop() server.stop()
self.assertTrue(self.handled.is_set()) self.assertTrue(self.handled.is_set())
self.assertEqual(len(self.messages), 1) self.assertEqual(len(self.messages), 1)