This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_telnetlib fails on OS X 10.6
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jackdied Nosy List: jackdied, mark.dickinson
Priority: normal Keywords: needs review, patch

Created on 2009-10-26 09:15 by mark.dickinson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue7207.patch mark.dickinson, 2009-10-26 10:00
Messages (5)
msg94481 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-10-26 09:15
test_telnetlib fails consistently on OS X 10.6, for a default (64-bit) 
build of py3k.  Test output below.

It looks to me as though this is just a race condition in the test 
(possibly combined with socket-related peculiarities of OS X) rather 
than a problem with telnetlib itself.  I suspect that the 'server' 
function in test_telnetlib.py is getting to the 'serv.close()' line 
prematurely, before all the test data from the 'test_write' test have 
been written.

Jack, I notice you've worked on these tests recently.  Any ideas?



testBasic (__main__.GeneralTests) ... ok
testTimeoutDefault (__main__.GeneralTests) ... ok
testTimeoutNone (__main__.GeneralTests) ... ok
testTimeoutOpen (__main__.GeneralTests) ... ok
testTimeoutValue (__main__.GeneralTests) ... ok
test_read_all_A (__main__.ReadTests) ... ok
test_read_all_B (__main__.ReadTests) ... ok
test_read_all_C (__main__.ReadTests) ... ok
test_read_eager_A (__main__.ReadTests) ... ok
test_read_eager_B (__main__.ReadTests) ... ok
test_read_lazy_A (__main__.ReadTests) ... ok
test_read_lazy_B (__main__.ReadTests) ... ok
test_read_some_A (__main__.ReadTests) ... ok
test_read_some_B (__main__.ReadTests) ... ok
test_read_some_C (__main__.ReadTests) ... ok
test_read_until_A (__main__.ReadTests) ... ok
test_read_until_B (__main__.ReadTests) ... ok
test_read_very_eager_A (__main__.ReadTests) ... ok
test_read_very_eager_B (__main__.ReadTests) ... ok
test_read_very_lazy_A (__main__.ReadTests) ... ok
test_read_very_lazy_B (__main__.ReadTests) ... ok
test_write (__main__.WriteTests) ... ERROR
test_IAC_commands (__main__.OptionTests) ... ok
test_SB_commands (__main__.OptionTests) ... ok
test_debuglevel_reads (__main__.OptionTests) ... ok
test_debuglevel_write (__main__.OptionTests) ... ok

======================================================================
ERROR: test_write (__main__.WriteTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_telnetlib.py", line 347, in test_write
    self._test_write(d)
  File "Lib/test/test_telnetlib.py", line 332, in _test_write
    self.telnet.write(data)
  File "/Users/dickinsm/python/svn/py3k/Lib/telnetlib.py", line 280, in 
write
    self.sock.sendall(buffer)
  File "Lib/test/test_telnetlib.py", line 317, in sendall
    self.socket.sendall(data)
socket.error: [Errno 32] Broken pipe

----------------------------------------------------------------------
Ran 26 tests in 10.179s

FAILED (errors=1)
Traceback (most recent call last):
  File "Lib/test/test_telnetlib.py", line 470, in <module>
    test_main()
  File "Lib/test/test_telnetlib.py", line 467, in test_main
    support.run_unittest(GeneralTests, ReadTests, WriteTests, 
OptionTests)
  File "/Users/dickinsm/python/svn/py3k/Lib/test/support.py", line 911, 
in run_unittest
    _run_suite(suite)
  File "/Users/dickinsm/python/svn/py3k/Lib/test/support.py", line 894, 
in _run_suite
    raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File "Lib/test/test_telnetlib.py", line 347, in test_write
    self._test_write(d)
  File "Lib/test/test_telnetlib.py", line 332, in _test_write
    self.telnet.write(data)
  File "/Users/dickinsm/python/svn/py3k/Lib/telnetlib.py", line 280, in 
write
    self.sock.sendall(buffer)
  File "Lib/test/test_telnetlib.py", line 317, in sendall
    self.socket.sendall(data)
socket.error: [Errno 32] Broken pipe
msg94484 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-10-26 10:00
Here's a patch that fixes the problem for me.  For each of the tests 
defined in WriteTests (there's only one at the moment), it forces the 
server to wait until the test is complete before closing the connection.
msg94485 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-10-26 10:26
Assigning to Jack for review.
msg94525 - (view) Author: Jack Diederich (jackdied) * (Python committer) Date: 2009-10-26 22:23
Looks good and works for me, please check it in.
msg94535 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-10-26 22:49
Thanks, Jack.  Applied in r75741.
History
Date User Action Args
2022-04-11 14:56:54adminsetgithub: 51456
2009-10-26 22:49:21mark.dickinsonsetstatus: open -> closed
resolution: fixed
messages: + msg94535

stage: patch review -> resolved
2009-10-26 22:23:38jackdiedsetmessages: + msg94525
2009-10-26 10:26:36mark.dickinsonsetkeywords: + needs review
assignee: jackdied
messages: + msg94485
2009-10-26 10:00:42mark.dickinsonsetfiles: + issue7207.patch
keywords: + patch
messages: + msg94484

stage: needs patch -> patch review
2009-10-26 09:15:10mark.dickinsoncreate