Unit test can not make sense in tests for availability_zones.reset_cache

Bug #1258041 reported by Chen Xiao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Chen Xiao

Bug Description

In test_availability_zones.py and and test_compute.py, There are two tests for availability_zones.reset_cache which can not make sense.

Follow code:
        az.reset_cache()
        self.assertIsNone(az._get_cache().get('cache'))

if we do not add cache for key 'cache', the result of az._get_cache().get('cache') before az.reset_cache() is same as after az.reset_cache(). So it can not make sense.
In test_compute.py, the wrong is in https://github.com/openstack/nova/blob/master/nova/tests/compute/test_compute.py#L8463

the change for test_compute.py is in my another review https://review.openstack.org/#/c/59922/,

Chen Xiao (chenxiao)
Changed in nova:
assignee: nobody → Chen Xiao (chenxiao)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: New → In Progress
Revision history for this message
Guangya Liu (Jay Lau) (jay-lau-513) wrote :

What is wrong with test_compute.py?

Revision history for this message
Chen Xiao (chenxiao) wrote :

the change for test_compute.py is in my another review https://review.openstack.org/#/c/59922/, I will change the bug context

description: updated
Dan Prince (dan-prince)
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/60165
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=0aff41a0214c8f751f01712a3423405b21bd7ce7
Submitter: Jenkins
Branch: master

commit 0aff41a0214c8f751f01712a3423405b21bd7ce7
Author: chenxiao <email address hidden>
Date: Thu Dec 5 15:31:40 2013 +0800

    Change unit test for availability_zones.reset_cache

    Test_rest_availability_zone_reset_cache can not make sense
    because the result of az._get_cache().get('cache') before
    executing az.reset_cache() and after az.reset_cache() are
    same.

    This Patch will provide a reasonable test for it.

    Change-Id: I7a27998bdf70f39077a5d79fc460974fc5806c3e
    Closes-bug: #1258041

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-3
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-3 → 2014.1
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.