Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_debuglevel from test_telnetlib.py fails #50997

Closed
LinuxDonald mannequin opened this issue Aug 21, 2009 · 19 comments
Closed

test_debuglevel from test_telnetlib.py fails #50997

LinuxDonald mannequin opened this issue Aug 21, 2009 · 19 comments
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@LinuxDonald
Copy link
Mannequin

LinuxDonald mannequin commented Aug 21, 2009

BPO 6748
Nosy @mdickinson, @pitrou, @jackdied, @ericvsmith, @ezio-melotti, @bitdancer
Files
  • issue6748.patch
  • simplified_6748.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/jackdied'
    closed_at = <Date 2009-11-06.21:17:29.086>
    created_at = <Date 2009-08-21.00:10:33.759>
    labels = ['type-bug', 'tests']
    title = 'test_debuglevel from test_telnetlib.py fails'
    updated_at = <Date 2009-11-06.21:17:29.085>
    user = 'https://bugs.python.org/LinuxDonald'

    bugs.python.org fields:

    activity = <Date 2009-11-06.21:17:29.085>
    actor = 'jackdied'
    assignee = 'jackdied'
    closed = True
    closed_date = <Date 2009-11-06.21:17:29.086>
    closer = 'jackdied'
    components = ['Tests']
    creation = <Date 2009-08-21.00:10:33.759>
    creator = 'LinuxDonald'
    dependencies = []
    files = ['15242', '15278']
    hgrepos = []
    issue_num = 6748
    keywords = ['patch', 'buildbot']
    message_count = 19.0
    messages = ['91798', '92219', '92222', '93173', '94768', '94769', '94770', '94771', '94774', '94790', '94971', '94973', '94974', '94975', '94976', '94983', '94985', '94995', '95001']
    nosy_count = 10.0
    nosy_names = ['mark.dickinson', 'pitrou', 'jackdied', 'eric.smith', 'ezio.melotti', 'Arfrever', 'r.david.murray', 'LinuxDonald', 'rb09', 'drukker']
    pr_nums = []
    priority = 'high'
    resolution = 'fixed'
    stage = 'commit review'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue6748'
    versions = ['Python 3.1', 'Python 3.2']

    @LinuxDonald
    Copy link
    Mannequin Author

    LinuxDonald mannequin commented Aug 21, 2009

    test test_telnetlib failed -- Traceback (most recent call last):
      File
    "/home/LinuxDonald/Downloads/Python-3.1.1/Lib/test/test_telnetlib.py",
    line 409, in test_debuglevel
        self._test_debuglevel([a, EOF_sigil], b)
      File
    "/home/LinuxDonald/Downloads/Python-3.1.1/Lib/test/test_telnetlib.py",
    line 389, in _test_debuglevel
        txt = telnet.read_all()
      File "/home/LinuxDonald/Downloads/Python-3.1.1/Lib/telnetlib.py", line
    325, in read_all
        self.fill_rawq()
      File "/home/LinuxDonald/Downloads/Python-3.1.1/Lib/telnetlib.py", line
    516, in fill_rawq
        buf = self.sock.recv(50)
    socket.error: [Errno 104] Connection reset by peer

    @LinuxDonald LinuxDonald mannequin added the tests Tests in the Lib/test dir label Aug 21, 2009
    @jackdied
    Copy link
    Contributor

    jackdied commented Sep 3, 2009

    I think this is fixed by r74638 but it never triggered on my box (Ubuntu
    9.x) so I can't be sure. What distro are you using?

    @jackdied jackdied self-assigned this Sep 3, 2009
    @LinuxDonald
    Copy link
    Mannequin Author

    LinuxDonald mannequin commented Sep 3, 2009

    Fedora 11 64 Bit

    @Arfrever
    Copy link
    Mannequin

    Arfrever mannequin commented Sep 27, 2009

    I can still reproduce this test failure after applying patch from
    r74638. I use Gentoo ~amd64.

    @Arfrever Arfrever mannequin changed the title test test_telnetlib failed test_debuglevel from test_telnetlib.py fails Sep 27, 2009
    @pitrou
    Copy link
    Member

    pitrou commented Oct 31, 2009

    This failure actually still happens quite regularly (on the buildbots
    and also on my Mandriva system).

    Judging from a quick Google search, errno 104 (ECONNRESET) should be
    treated as a case of EOF (it means the TCP connection was reset using
    RST rather than FIN, which apparently sometimes happens).

    Besides, the test flow in test_telnetlib really is a mess (setUp and
    tearDown getting called multiple times, for example), could you clean it up?

    @drukker
    Copy link
    Mannequin

    drukker mannequin commented Oct 31, 2009

    This patch fixes the issue.

    @ericvsmith
    Copy link
    Member

    I still get 'Connection reset by peer' on OS/X 10.5.8 with this patch
    (http://bugs.python.org/file15242/issue6748.patch).

    @jackdied
    Copy link
    Contributor

    Antoine Pitrou: Besides, the test flow in test_telnetlib really is a
    mess (setUp and tearDown getting called multiple times, for example),
    could you clean it up?

    Yes, I'm working on refactoring the test server and separating out
    testing that versus testing the telnetlib. It is the test server (which
    started simple and then grew cruft) which seems to have OS specific
    problems.

    @drukker
    Copy link
    Mannequin

    drukker mannequin commented Oct 31, 2009

    The change in the patch worked for me on py3k on Ubuntu 9.10. It makes
    sense, though, that it could still fail: conn can get closed too soon.

    @pitrou
    Copy link
    Member

    pitrou commented Nov 1, 2009

    Please note that the Windows buildbot shows another error:

    ======================================================================
    ERROR: test_debuglevel (test.test_telnetlib.OptionTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File
    "E:\cygwin\home\db3l\buildarea\3.1.bolen-windows\build\lib\test\test_telnetlib.py",
    line 409, in test_debuglevel
        self._test_debuglevel([a, EOF_sigil], b)
      File
    "E:\cygwin\home\db3l\buildarea\3.1.bolen-windows\build\lib\test\test_telnetlib.py",
    line 389, in _test_debuglevel
        txt = telnet.read_all()
      File
    "E:\cygwin\home\db3l\buildarea\3.1.bolen-windows\build\lib\telnetlib.py", line
    325, in read_all
        self.fill_rawq()
      File
    "E:\cygwin\home\db3l\buildarea\3.1.bolen-windows\build\lib\telnetlib.py", line
    516, in fill_rawq
        buf = self.sock.recv(50)
    socket.error: [Errno 10053] An established connection was aborted by the
    software in your host machine

    According to a quick search on the Web, 10053 under Windows would be for
    ECONNABORTED. Bazaar apparently faced the same issue:

    https://lists.ubuntu.com/archives/bazaar/2006q4/020035.html

    @jackdied
    Copy link
    Contributor

    jackdied commented Nov 6, 2009

    Simplified tests attached. Instead of bulking up and testing the TCP
    server implementation I ended up mocking/stubing the socket recv/sendall
    and select.select functions. The only tests that use real sockets are
    the ones to test timeouts. Therefore test_telnetlib.py should be
    platform neutral (let test_socket.py figure that stuff out).

    Unless this blows up for anyone I'll check it in later today.

    @mdickinson
    Copy link
    Member

    With these test simplifications, it looks as though you could lose some
    imports as well. (E.g., queue, os).

    Patch works fine for me on 64-bit Linux. I'll test it on OS X (10.5 and
    10.6) when I get home tonight.

    @jackdied
    Copy link
    Contributor

    jackdied commented Nov 6, 2009

    ran pyflakes and removed unused imports.

    @ericvsmith
    Copy link
    Member

    The new patch works for me on 32-bit OS X 10.5. I think the approach of
    mocking the sockets is a good idea, although I haven't reviewed the
    patch itself.

    @mdickinson
    Copy link
    Member

    The most recent patch (http://bugs.python.org/file15278) works for
    me on OS X 10.4/PPC (32-bit), OS X 10.5/Intel (32-bit) and OS X 10.6/Intel
    (64-bit).

    @bitdancer
    Copy link
    Member

    The patch runs clean on my Gentoo buildbot, which otherwise fails
    consistently. I say apply it, I doubt you'd be making things worse by
    doing so :)

    Using minimal mocks with as few external dependencies as possible is
    considered good unit-testing practice, from what I understand.

    @bitdancer bitdancer added the type-bug An unexpected behavior, bug, or error label Nov 6, 2009
    @jackdied
    Copy link
    Contributor

    jackdied commented Nov 6, 2009

    committed in rev 76133

    @jackdied jackdied closed this as completed Nov 6, 2009
    @bitdancer
    Copy link
    Member

    Jack, this failure is happening also in 3.1. I tried to merge the
    revision, but there are too many differences between 3.x and 3.1 for me
    to be confident that I'd get it right. Could you do the backport, please?

    @bitdancer bitdancer reopened this Nov 6, 2009
    @jackdied
    Copy link
    Contributor

    jackdied commented Nov 6, 2009

    backported to maint via svnmerge in r76136. 3.1 and 3.x
    test_telnetlib.py's (and telnetlib.py's) are now identical.

    @jackdied jackdied closed this as completed Nov 6, 2009
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants