Skip to content

[nox] Test fails when nox fails to download dependencies #3485

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

Closed
tmatsuo opened this issue Apr 23, 2020 · 5 comments
Closed

[nox] Test fails when nox fails to download dependencies #3485

tmatsuo opened this issue Apr 23, 2020 · 5 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. testing type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@tmatsuo
Copy link
Contributor

tmatsuo commented Apr 23, 2020

Maybe we should retry few times.

Example log:

 Using noxfile-template from parent folder (/tmpfs/src/github/python-docs-samples).

Running session py-3.7
Creating virtual environment (virtualenv) using python3.7 in .nox/py-3-7
pip install -r requirements.txt
Command pip install -r requirements.txt failed with exit code 2:
Ignoring tensorflow: markers 'python_version < "3.0"' don't match your environment
Collecting tensorflow==2.0.1
  Downloading tensorflow-2.0.1-cp37-cp37m-manylinux2010_x86_64.whl (86.3 MB)
ERROR: Exception:
Traceback (most recent call last):
  File "/tmpfs/src/github/python-docs-samples/ml_engine/online_prediction/.nox/py-3-7/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 425, in _error_catcher
    yield
  File "/tmpfs/src/github/python-docs-samples/ml_engine/online_prediction/.nox/py-3-7/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 507, in read
    data = self._fp.read(amt) if not fp_closed else b""
  File "/tmpfs/src/github/python-docs-samples/ml_engine/online_prediction/.nox/py-3-7/lib/python3.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 62, in read
    data = self.__fp.read(amt)
  File "/usr/local/lib/python3.7/http/client.py", line 457, in read
    n = self.readinto(b)
  File "/usr/local/lib/python3.7/http/client.py", line 501, in readinto
    n = self.fp.readinto(b)
  File "/usr/local/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
  File "/usr/local/lib/python3.7/ssl.py", line 1071, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/local/lib/python3.7/ssl.py", line 929, in read
    return self._sslobj.read(len, buffer)
ConnectionResetError: [Errno 104] Connection reset by peer
@tmatsuo tmatsuo added testing priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Apr 23, 2020
@tmatsuo tmatsuo self-assigned this Apr 23, 2020
@tmatsuo
Copy link
Contributor Author

tmatsuo commented Apr 23, 2020

The first option came to mind is to use backoff in our noxfile-template.py.
I think we can retry upon nox.command.CommandFailed.

If we do this, we have to install backoff locally, and also install backoff alongside with nox in the run-tests.sh.

Maybe we want to retry only for transient errors, but we need to determine this by looking at the error log (through nox.command.CommandFailed I guess).

@kurtisvg @gguuss
WDYT?

@kurtisvg
Copy link
Contributor

Are these happening frequently enough that's it's worth adding logic for this? Or was this a one off error?

@tmatsuo
Copy link
Contributor Author

tmatsuo commented Apr 24, 2020

I have only seen one time. It's one off, but potentially it can happen anytime.
It's worth adding in my opinion, but there is also a downside of requiring backoff locally.

Other option is to add retry to nox itself.

@tmatsuo
Copy link
Contributor Author

tmatsuo commented Apr 24, 2020

Let's see how often we'll see this. I'll add occurrences to this issue whenever I see the same error.

@tmatsuo
Copy link
Contributor Author

tmatsuo commented May 6, 2020

According to https://pip.pypa.io/en/stable/reference/pip/

It seems that pip already retries 5 times. In that case, I don't think more retry would improve the situation. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. testing type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants