Autopkgtest fails when HTTP proxy is used

Bug #1974182 reported by Olivier Gayot
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
requests (Debian)
Fix Released
Unknown
requests (Ubuntu)
Fix Released
Medium
Olivier Gayot

Bug Description

The following tests fail because either of the following environment variables is set:
* http_proxy
* https_proxy
* no_proxy

The requests package supports these variables and the tests override their to test the behavior. However, the test suite does not expect these variables to already be set.

FAILED tests/test_requests.py::TestRequests::test_errors[http://doesnotexist.google.com-ConnectionError]
FAILED tests/test_requests.py::TestRequests::test_respect_proxy_env_on_send_self_prepared_request
FAILED tests/test_requests.py::TestRequests::test_respect_proxy_env_on_send_session_prepared_request
FAILED tests/test_requests.py::TestRequests::test_respect_proxy_env_on_send_with_redirects
FAILED tests/test_requests.py::TestRequests::test_respect_proxy_env_on_get - ...
FAILED tests/test_requests.py::TestRequests::test_respect_proxy_env_on_request

Olivier Gayot (ogayot)
Changed in requests (Ubuntu):
assignee: nobody → Olivier Gayot (ogayot)
Revision history for this message
Olivier Gayot (ogayot) wrote (last edit ):

Adding debdiff, which was forwarded to Debian.

Changed in requests (Ubuntu):
status: New → Confirmed
Revision history for this message
Olivier Gayot (ogayot) wrote :

Opened two PR upstream:

* https://github.com/psf/requests/pull/6137 to override the HTTP proxy variables when running the test suite.
* https://github.com/psf/requests/pull/6136 to make timeout failures more obvious. I encountered the issue while debugging the issue with HTTP proxy. Tests were failing because of a timeout but the output would only show:

E urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fc3a3e30a90>: Failed to establish a new connection: [Errno 111] Connection refused

/usr/lib/python3/dist-packages/urllib3/connection.py:181: NewConnectionError

Changed in requests (Debian):
status: Unknown → New
Revision history for this message
Brian Murray (brian-murray) wrote :

This was sponsored but the Ubuntu Sponsors team was not unsubscribed.

requests (2.27.1+dfsg-1ubuntu1) kinetic; urgency=medium

  * Fix autopkgtest when http_proxy, https_proxy or no_proxy variable is set
    (LP: #1974182)

 -- Olivier Gayot <email address hidden> Thu, 19 May 2022 14:14:07 +0200

Changed in requests (Ubuntu):
status: Confirmed → Fix Committed
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package requests - 2.27.1+dfsg-1ubuntu2

---------------
requests (2.27.1+dfsg-1ubuntu2) kinetic; urgency=medium

  * d/p/remove-charset-normalizer-dependency.patch: Remove charset-normalizer
    as a dependency of requests (LP: #1975541)

requests (2.27.1+dfsg-1ubuntu1) kinetic; urgency=medium

  * Fix autopkgtest when http_proxy, https_proxy or no_proxy variable is set
    (LP: #1974182)

 -- Lena Voytek <email address hidden> Mon, 23 May 2022 15:06:07 -0700

Changed in requests (Ubuntu):
status: Fix Committed → Fix Released
Changed in requests (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.