New version of requests library breaks unit tests

Bug #1364893 reported by Pawel Koniszewski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Undecided
Pawel Koniszewski

Bug Description

The newest version of requests library - 2.4.0 - updated underlying library 'urllib3' to version 1.9.
Unfortunately this version of urllib3 introduced new exception, ProtocolError, which breaks unit tests. This causes Jenkins to fail in every change set.

https://pypi.python.org/pypi/requests (Updated bundled urllib3 version.)
https://pypi.python.org/pypi/urllib3 (urllib3.exceptions.ConnectionError renamed to urllib3.exceptions.ProtocolError. (Issue #326))

My solution is to change requirements so we will not use the newest version of requests in python-glanceclient.

Changed in glance:
assignee: nobody → Pawel Koniszewski (pawel-koniszewski)
status: New → In Progress
Revision history for this message
Pawel Koniszewski (pawel-koniszewski) wrote :
affects: glance → python-glanceclient
Revision history for this message
Zhi Yan Liu (lzy-dev) wrote :

I trend to fix this issue directly in code - to catch both exception easily instead of pin requests version. Actually change #118627 is just trying this way.

Revision history for this message
Pawel Koniszewski (pawel-koniszewski) wrote :

I agree with you Zhi. Requirement change was the first and the easiest approach, but not as good as support for ProtocolError.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-glanceclient (master)

Change abandoned by Erno Kuvaja (<email address hidden>) on branch: master
Review: https://review.openstack.org/118600
Reason: consensus was to take another approach

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/118627
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=16077d91ddfeebe77a3c6d7fedc7125ddff17bdb
Submitter: Jenkins
Branch: master

commit 16077d91ddfeebe77a3c6d7fedc7125ddff17bdb
Author: Pawel Koniszewski <email address hidden>
Date: Wed Sep 3 08:58:55 2014 -0400

    Catch new urllib3 exception: ProtocolError

    The new version of requests (2.4.0) has updated underlying urllib3
    to version 1.9. Unfortunately urllib3 introduced new exception
    ProtocolError. Because of that unit tests in glance are failing:
    ProtocolError: ('Connection aborted.', gaierror(-2, 'Name or service not known'))

    To solve this problem new urllib3 exception is caught in the same place
    that the old one was. Unfortunately both exception are still in use so
    I couldn't remove the old one.

    Change-Id: I55eef98e734c59b9b627f182768a633b2b701e43
    Closes-Bug: #1364893

Changed in python-glanceclient:
status: In Progress → Fix Committed
Louis Taylor (kragniz)
Changed in python-glanceclient:
status: Fix Committed → 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.