msg91798 - (view) |
Author: Thomas Kowaliczek (LinuxDonald) |
Date: 2009-08-21 00:10 |
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 |
|
|
msg92219 - (view) |
Author: Jack Diederich (jackdied) *  |
Date: 2009-09-03 20:42 |
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? |
|
|
msg92222 - (view) |
Author: Thomas Kowaliczek (LinuxDonald) |
Date: 2009-09-03 21:24 |
Fedora 11 64 Bit |
|
|
msg93173 - (view) |
Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) *  |
Date: 2009-09-27 15:18 |
I can still reproduce this test failure after applying patch from r74638. I use Gentoo ~amd64. |
|
|
msg94768 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2009-10-31 21:38 |
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? |
|
|
msg94769 - (view) |
Author: Derk Drukker (drukker) |
Date: 2009-10-31 21:54 |
This patch fixes the issue. |
|
|
msg94770 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2009-10-31 22:07 |
I still get 'Connection reset by peer' on OS/X 10.5.8 with this patch (http://bugs.python.org/file15242/issue6748.patch). |
|
|
msg94771 - (view) |
Author: Jack Diederich (jackdied) *  |
Date: 2009-10-31 22:21 |
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. |
|
|
msg94774 - (view) |
Author: Derk Drukker (drukker) |
Date: 2009-10-31 22:27 |
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. |
|
|
msg94790 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2009-11-01 16:23 |
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 |
|
|
msg94971 - (view) |
Author: Jack Diederich (jackdied) *  |
Date: 2009-11-06 14:32 |
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. |
|
|
msg94973 - (view) |
Author: Mark Dickinson (mark.dickinson) *  |
Date: 2009-11-06 14:53 |
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. |
|
|
msg94974 - (view) |
Author: Jack Diederich (jackdied) *  |
Date: 2009-11-06 15:02 |
ran pyflakes and removed unused imports. |
|
|
msg94975 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2009-11-06 15:21 |
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. |
|
|
msg94976 - (view) |
Author: Mark Dickinson (mark.dickinson) *  |
Date: 2009-11-06 15:44 |
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). |
|
|
msg94983 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2009-11-06 17:15 |
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. |
|
|
msg94985 - (view) |
Author: Jack Diederich (jackdied) *  |
Date: 2009-11-06 17:21 |
committed in rev 76133 |
|
|
msg94995 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2009-11-06 19:27 |
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? |
|
|
msg95001 - (view) |
Author: Jack Diederich (jackdied) *  |
Date: 2009-11-06 21:17 |
backported to maint via svnmerge in r76136. 3.1 and 3.x test_telnetlib.py's (and telnetlib.py's) are now identical. |
|
|