classification
Title: test_smtpnet failed with SMTPServerDisconnected on x86 Gentoo Non-Debug with X 3.10
Type: Stage:
Components: Tests Versions: Python 3.11, Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: corona10, erlendaasland, vstinner
Priority: normal Keywords:

Created on 2021-06-09 08:12 by vstinner, last changed 2021-06-09 14:59 by corona10.

Messages (1)
msg395393 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-06-09 08:12
x86 Gentoo Non-Debug with X 3.10:
https://buildbot.python.org/all/#/builders/698/builds/112

This buildbot worker has Internet connection issues, so my concern is only how test_smtpnet handles Internet issues.

The two tests which fail use "with socket_helper.transient_internet(self.testServer):", but it seems like this context manager doesn't catch SMTPServerDisconnected.

Maybe transient_internet() should be modified to catch smtplib.SMTPServerDisconnected (or even the generic smtplib.SMTPException)?

======================================================================
ERROR: test_connect_default_port (test.test_smtpnet.SmtpSSLTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/test/test_smtpnet.py", line 60, in test_connect_default_port
    server = smtplib.SMTP_SSL(self.testServer)
  File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 1045, in __init__
    SMTP.__init__(self, host, port, local_hostname, timeout,
  File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 255, in __init__
    (code, msg) = self.connect(host, port)
  File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 343, in connect
    (code, msg) = self.getreply()
  File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 400, in getreply
    raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed

======================================================================
ERROR: test_connect_using_sslcontext (test.test_smtpnet.SmtpSSLTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/test/test_smtpnet.py", line 70, in test_connect_using_sslcontext
    server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=context)
  File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 1045, in __init__
    SMTP.__init__(self, host, port, local_hostname, timeout,
  File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 255, in __init__
    (code, msg) = self.connect(host, port)
  File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 343, in connect
    (code, msg) = self.getreply()
  File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 400, in getreply
    raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed
History
Date User Action Args
2021-06-09 14:59:49corona10setnosy: + corona10
2021-06-09 08:15:46erlendaaslandsetnosy: + erlendaasland
2021-06-09 08:12:30vstinnercreate