Functional tests spend too much time creating the DB

Bug #1172475 reported by John Bresnahan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
John Bresnahan

Bug Description

Every functional test in glance that creates a registry service and/or a api service also creates a fresh sqlite db by forking out a call to glance-manage db_sync. This is expensive now, and will only get more expensive, because db_sync must walk every migration.

We should change that a clean db is only created once and then cached. A copy of the cache could then be used for each test. An initial proof of concept shows that this could speed up tests by 3x

Changed in glance:
assignee: nobody → John Bresnahan (jbresnah)
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/27450

Changed in glance:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/27450
Committed: http://github.com/openstack/glance/commit/d41561151c7bd4917a36382340d040ed843a794b
Submitter: Jenkins
Branch: master

commit d41561151c7bd4917a36382340d040ed843a794b
Author: John Bresnahan <email address hidden>
Date: Wed Apr 24 11:35:24 2013 -1000

    Functional tests use a clean cached db that is only created once.

    This eliminates the need for 'glance-manage db_sync' to be called
    once (and often twice) for every test. db_sync is an expensive
    operation because it must walk through ever database migration.
    With this patch, the first time the db is created it is cached
    before it is used. Instead of creating the db in future tests
    the cached file is copied. An atexit() function is used to clean
    up the file when the tests are complete.

    fixes bug: 1172475
    blueprint: refactoring-better-faster-stronger-functional-tests

    Change-Id: I96e35c640256bf27ff17da0b5f558bda02906a07

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → havana-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: havana-1 → 2013.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.