Some tests slow when using proxy

Bug #1025756 reported by Stuart McLaren
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
Stuart McLaren

Bug Description

When developing on a system which uses a http proxy some of the tests run, but require a timeout of about ~60 seconds.
Typically they access 'example.com' and end up in the http store querying for the image size timeout and set it to '0':

    def get_size(self, location):
        """
        Takes a `glance.store.location.Location` object that indicates
        where to find the image file, and returns the size

        :param location `glance.store.location.Location` object, supplied
                        from glance.store.location.get_location_from_uri()
        """
        try:
            return self._query(location, 'HEAD')[2]
        except Exception:
            return 0

Setting 'example.com' to 'localhost' should give the same behaviour but without the extra ~60 seconds to timeout.

Changed in glance:
assignee: nobody → Stuart McLaren (stuart-mclaren)
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

The worst offenders:

test_bad_container_format 63.60
test_bad_disk_format 63.75
test_add_image_no_location_no_image_as_body 64.22
test_add_no_name 72.08
test_add_with_location_and_stdin 72.20
test_add_with_location 72.27
test_add_location_without_checksum 72.32
test_add_location_with_checksum 72.60
test_add_list_update_list 73.53
test_defaulted_amazon_format 761.86

Replacing example.com with localhost for these tests improves run times:

test_bad_container_format 0.20
test_bad_disk_format 0.36
test_add_image_no_location_no_image_as_body 0.35
test_add_no_name 7.34
test_add_with_location_and_stdin 9.17
test_add_with_location 9.43
test_add_location_without_checksum 8.96
test_add_location_with_checksum 8.93
test_add_list_update_list 11.66
test_defaulted_amazon_format 0.81

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/9957

Changed in glance:
status: New → In Progress
Brian Waldon (bcwaldon)
Changed in glance:
importance: Undecided → Medium
milestone: none → folsom-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/9957
Committed: http://github.com/openstack/glance/commit/251c5e588a168d4aae406e28d2c8da1e307f4275
Submitter: Jenkins
Branch: master

commit 251c5e588a168d4aae406e28d2c8da1e307f4275
Author: Stuart McLaren <email address hidden>
Date: Wed Jul 18 09:18:55 2012 +0000

    Replace example.com with localhost for some tests

    Fix for LP Bug #1025756.

    When running the unit tests on a system without a
    direct internet connection some tests run slowly.
    Replacing example.com with localhost:0 speeds up
    the relevant tests.

    Change-Id: Iac6fc506b1d36b18ab21bb956ec2d8acc004bba8

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: folsom-3 → 2012.2
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.