classification
Title: test_timeout should skip, not fail, when the remote host is not available
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: pitrou, sandro.tosi
Priority: normal Keywords: patch

Created on 2009-12-19 16:45 by pitrou, last changed 2010-10-29 18:17 by pitrou. This issue is now closed.

Files
File name Uploaded Description Edit
issue7547-py3k.patch sandro.tosi, 2010-10-29 17:57
Messages (3)
msg96615 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-12-19 16:45
test_timeout uses www.python.org as a Guinea pig for its socket tests.
Unfortunately sometimes www.python.org is down, which gives the
following kind of failures (seen on a buildbot recently):

test test_timeout failed -- Traceback (most recent call last):
  File "C:\buildslave\3.x.moore-windows\build\lib\test\test_timeout.py",
line 133, in testRecvTimeout
    self.sock.connect(self.addr_remote)
socket.error: [Errno 10060] A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond

test_timeout should catch the error and simply skip the test with an
appropriate message.

There's a similar problem with test_smtpnet which uses gmail as its
remote SMTP-SSL provider.
msg119919 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2010-10-29 17:57
Hello,
as discussed on irc, I'm proposing a patch that:

- wraps the test with support.transient_internet
- limits the assert to only socket.timeout (what we want to test)

test_smptnet.py is already fixed, since it already uses support.transient_internet

Regards,
Sandro
msg119924 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-10-29 18:17
Committed in r85931 (3.2), r85932 (3.1) and r85933 (2.7).
History
Date User Action Args
2010-10-29 18:17:46pitrousetstatus: open -> closed
resolution: fixed
messages: + msg119924

stage: patch review -> resolved
2010-10-29 17:57:41sandro.tosisetfiles: + issue7547-py3k.patch

nosy: + sandro.tosi
messages: + msg119919

keywords: + patch
stage: needs patch -> patch review
2010-07-11 11:03:08BreamoreBoysetversions: - Python 2.6
2009-12-19 16:45:03pitroucreate