classification
Title: test_imaplib.RemoteIMAP_STARTTLSTest.test_logout() fails randomly
Type: Stage: resolved
Components: email, Library (Lib) Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: barry, r.david.murray, vstinner, xtreak
Priority: normal Keywords: patch

Created on 2019-03-18 14:57 by vstinner, last changed 2019-04-15 16:45 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 12411 merged vstinner, 2019-03-18 15:14
PR 12846 merged vstinner, 2019-04-15 16:27
Messages (8)
msg338233 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-03-18 14:57
https://buildbot.python.org/all/#/builders/21/builds/2512

======================================================================
FAIL: test_logout (test.test_imaplib.RemoteIMAP_STARTTLSTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/test_imaplib.py", line 946, in test_logout
    self.assertEqual(rs[0], 'BYE')
AssertionError: 'NO' != 'BYE'
- NO
+ BYE


The logout() returns 'NO' if *any* exception is raised:

        try: typ, dat = self._simple_command('LOGOUT')
        except: typ, dat = 'NO', ['%s: %s' % sys.exc_info()[:2]]

Attached PR proposes a fix.
msg338235 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python triager) Date: 2019-03-18 15:06
Seems it used to fail randomly in past too : issue30648
msg338244 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-03-18 15:32
> Seems it used to fail randomly in past too : issue30648

Well, test_logout() fails randomly every 6 months, but when it fails: we have zero info about the bug. The "NO" in the error means that an exception has been raised and the server didn't reply to the "LOGOUT" command.
msg338245 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-03-18 15:34
> https://buildbot.python.org/all/#/builders/21/builds/2512

It's s390x RHEL 3.x.
msg338385 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-03-19 16:42
See also bpo-35462.
msg340292 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-04-15 16:23
New changeset 74125a60b7a477451ff2b8385bfbce3fdaee8dbc by Victor Stinner in branch 'master':
bpo-36348: IMAP4.logout() doesn't ignore exc (GH-12411)
https://github.com/python/cpython/commit/74125a60b7a477451ff2b8385bfbce3fdaee8dbc
msg340293 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-04-15 16:24
I pushed a change to get more information if the test fails again.
msg340296 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-04-15 16:45
New changeset 2815bf5b1f39b9f677135473392887a8d261fc97 by Victor Stinner in branch '3.7':
bpo-36348: test_imaplib: add debug info (GH-12846)
https://github.com/python/cpython/commit/2815bf5b1f39b9f677135473392887a8d261fc97
History
Date User Action Args
2019-04-15 16:45:07vstinnersetmessages: + msg340296
2019-04-15 16:27:36vstinnersetpull_requests: + pull_request12771
2019-04-15 16:24:21vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg340293

stage: patch review -> resolved
2019-04-15 16:23:46vstinnersetmessages: + msg340292
2019-03-19 16:42:32vstinnersetmessages: + msg338385
2019-03-18 15:34:22vstinnersetmessages: + msg338245
2019-03-18 15:32:38vstinnersetmessages: + msg338244
2019-03-18 15:14:51vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request12365
2019-03-18 15:06:20xtreaksetnosy: + barry, xtreak, r.david.murray
messages: + msg338235
components: + email
2019-03-18 14:57:13vstinnercreate