Skip to content

Replace network decorator with with_connectivity_check #6111

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

Merged
1 commit merged into from
Jan 28, 2014

Conversation

jtratner
Copy link
Contributor

Network decorator was ignoring test failures due to API changes in external
services.

Closes #5816.

Network decorator was ignoring test failures due to API changes in
external services.
@ghost
Copy link

ghost commented Jan 28, 2014

👍. looks good.

The only issue is that we potentially have a box sitting on AWS's (travis) pipe
flooding google.com with requests. But I can't see how that would actually happen.
Bombs away.

ghost pushed a commit that referenced this pull request Jan 28, 2014
Replace network decorator with with_connectivity_check
@ghost ghost merged commit 1b43f0f into pandas-dev:master Jan 28, 2014
@jreback
Copy link
Contributor

jreback commented Jan 28, 2014

Is this a legit error the network decorator should catch?
http://scatterci.github.io/ScatterCI-Pandas/ on this commit: 54945de2

=============================================================================
ERROR: test_get_near_stock_price (pandas.io.tests.test_data.TestYahooOptions)
-----------------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
    function()
  File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/site-packages/pandas/util/testing.py", line 1086, in wrapper
    return t(*args, **kwargs)
  File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/site-packages/pandas/io/tests/test_data.py", line 279, in test_get_near_stock_price
    expiry=self.expiry)
  File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/site-packages/pandas/io/data.py", line 781, in get_near_stock_price
    price = float(get_quote_yahoo([self.symbol])['last'])
  File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/site-packages/pandas/io/data.py", line 132, in get_quote_yahoo
    with urlopen(url_str) as url:
  File "/usr/lib/python3.3/urllib/request.py", line 156, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.3/urllib/request.py", line 475, in open
    response = meth(req, response)
  File "/usr/lib/python3.3/urllib/request.py", line 587, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.3/urllib/request.py", line 507, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 447, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 692, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.3/urllib/request.py", line 469, in open
    response = self._open(req, data)
  File "/usr/lib/python3.3/urllib/request.py", line 487, in _open
    '_open', req)
  File "/usr/lib/python3.3/urllib/request.py", line 447, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 1268, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib/python3.3/urllib/request.py", line 1253, in do_open
    r = h.getresponse()
  File "/usr/lib/python3.3/http/client.py", line 1147, in getresponse
    response.begin()
  File "/usr/lib/python3.3/http/client.py", line 358, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.3/http/client.py", line 320, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.3/socket.py", line 297, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer

@jtratner
Copy link
Contributor Author

Probably, but I recall issues with all the different error types for
sockets and other IO errors. @cpcloud - you have any recollection where
this ended up?
On Jan 28, 2014 5:26 AM, "jreback" notifications@github.com wrote:

Is this a legit error the network decorator should catch?
http://scatterci.github.io/ScatterCI-Pandas/ on this commit:
54945dehttps://github.com/pydata/pandas/commit/54945de2

ERROR: test_get_near_stock_price (pandas.io.tests.test_data.TestYahooOptions)

Traceback (most recent call last):
File "/usr/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/site-packages/pandas/util/testing.py",
line 1086, in wrapper
return t(_args, *_kwargs)
File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/site-packages/pandas/io/tests/test_data.py",
line 279, in test_get_near_stock_price
expiry=self.expiry)
File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/site-packages/pandas/io/data.py",
line 781, in get_near_stock_price
price = float(get_quote_yahoo([self.symbol])['last'])
File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/site-packages/pandas/io/data.py",
line 132, in get_quote_yahoo
with urlopen(url_str) as url:
File "/usr/lib/python3.3/urllib/request.py", line 156, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.3/urllib/request.py", line 475, in open
response = meth(req, response)
File "/usr/lib/python3.3/urllib/request.py", line 587, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.3/urllib/request.py", line 507, in error
result = self._call_chain(_args)
File "/usr/lib/python3.3/urllib/request.py", line 447, in _call_chain
result = func(_args)
File "/usr/lib/python3.3/urllib/request.py", line 692, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/lib/python3.3/urllib/request.py", line 469, in open
response = self._open(req, data)
File "/usr/lib/python3.3/urllib/request.py", line 487, in _open
'_open', req)
File "/usr/lib/python3.3/urllib/request.py", line 447, in _call_chain
result = func(*args)
File "/usr/lib/python3.3/urllib/request.py", line 1268, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.3/urllib/request.py", line 1253, in do_open
r = h.getresponse()
File "/usr/lib/python3.3/http/client.py", line 1147, in getresponse
response.begin()
File "/usr/lib/python3.3/http/client.py", line 358, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.3/http/client.py", line 320, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.3/socket.py", line 297, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer

Reply to this email directly or view it on
GitHubhttps://github.com//pull/6111#issuecomment-33477578
.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@network decorator can mask failed tests
2 participants