[New-bugs-announce] [issue25859] EOFError in test_nntplib.NetworkedNNTPTests.test_starttls()

Martin Panter report at bugs.python.org
Mon Dec 14 04:00:26 EST 2015


New submission from Martin Panter:

The AMD64 Debian root buildbot and the x86 Gentoo Installed with X buildbot have been persistently failing test_nntplib for a while, and I can also reproduce it locally when “test -unetwork” is enabled. Six test cases fail. There is a pause before test_starttls() fails, then all the others fail immediately:

test_newgroups (test.test_nntplib.NetworkedNNTPTests) ... ok
test_over (test.test_nntplib.NetworkedNNTPTests) ... ok
test_starttls (test.test_nntplib.NetworkedNNTPTests) ... ERROR
test_unknown_command (test.test_nntplib.NetworkedNNTPTests) ... ERROR
test_welcome (test.test_nntplib.NetworkedNNTPTests) ... ok
test_with_statement (test.test_nntplib.NetworkedNNTPTests) ... ok
test_xhdr (test.test_nntplib.NetworkedNNTPTests) ... ERROR
test_xover (test.test_nntplib.NetworkedNNTPTests) ... ERROR
test_zlogin (test.test_nntplib.NetworkedNNTPTests) ... ERROR
test_zzquit (test.test_nntplib.NetworkedNNTPTests) ... ERROR
test_article_head_body (test.test_nntplib.NetworkedNNTP_SSLTests) ... ok
test_capabilities (test.test_nntplib.NetworkedNNTP_SSLTests) ... ok

Traceback from first failure:

======================================================================
ERROR: test_starttls (test.test_nntplib.NetworkedNNTPTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/media/disk/home/proj/python/cpython/Lib/test/test_nntplib.py", line 252, in wrapped
    meth(self)
  File "/media/disk/home/proj/python/cpython/Lib/test/test_nntplib.py", line 210, in test_starttls
    self.server.starttls()
  File "/media/disk/home/proj/python/cpython/Lib/nntplib.py", line 1014, in starttls
    self.getcapabilities()
  File "/media/disk/home/proj/python/cpython/Lib/nntplib.py", line 390, in getcapabilities
    resp, caps = self.capabilities()
  File "/media/disk/home/proj/python/cpython/Lib/nntplib.py", line 558, in capabilities
    resp, lines = self._longcmdstring("CAPABILITIES")
  File "/media/disk/home/proj/python/cpython/Lib/nntplib.py", line 525, in _longcmdstring
    resp, list = self._getlongresp(file)
  File "/media/disk/home/proj/python/cpython/Lib/nntplib.py", line 476, in _getlongresp
    resp = self._getresp()
  File "/media/disk/home/proj/python/cpython/Lib/nntplib.py", line 449, in _getresp
    resp = self._getline()
  File "/media/disk/home/proj/python/cpython/Lib/nntplib.py", line 437, in _getline
    if not line: raise EOFError
EOFError

It seems like as soon as the TLS connection is successfully set up, the server (news.trigofacile.com) shuts down the connection.

Would it be appropriate to change this test so that instead of connecting to a remote server, we connect to a local server running in a background thread? I attach a Python script that runs a minimal server with hardcoded responses allowing test_starttls() to pass. Perhaps we could use this for test_starttls(). Maybe even extend it to other remote server tests as well.

----------
components: Tests
files: starttls_server.py
keywords: buildbot
messages: 256374
nosy: martin.panter
priority: normal
severity: normal
status: open
title: EOFError in test_nntplib.NetworkedNNTPTests.test_starttls()
type: behavior
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41303/starttls_server.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25859>
_______________________________________


More information about the New-bugs-announce mailing list