quota unit test failure

Bug #1612222 reported by Kevin Benton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Kevin Benton

Bug Description

spotted failure in a unit test unrelated to the patch. appears to be a result of leaked resources between the tests.

===
FAIL: neutron.tests.unit.quota.test_resource_registry.TestAuxiliary
Functions.test_set_resources_dirty
tags: worker-0
-------------------------------------------------------------------
---
Empty attachments:
  pythonlogging:''
  stderr
  stdout

Traceback (most recent call last):
  File "neutron/tests/unit/quota/test_resource_registry.py", line 9
0, in setUp
    self.registry.unregister_resources()
  File "neutron/quota/resource_registry.py", line 239, in unregiste
r_resources
    res.unregister_events()
AttributeError: 'CountableResource' object has no attribute 'unregi
ster_events'

Tags: unittest
Changed in neutron:
assignee: nobody → Kevin Benton (kevinbenton)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → High
tags: added: unite
tags: added: unittest
removed: unite
Revision history for this message
Darren Shaw (dronshaw) wrote :

I wasn't able to reproduce after running neutron.tests.unit.quota.test_resource_registry.TestAuxiliary
Functions.test_set_resources_dirty. Am I missing something :)?

Changed in neutron:
milestone: none → newton-rc1
Revision history for this message
Kevin Benton (kevinbenton) wrote :

It depends on another test registering a resource as tracked, then a different one registering it as countable, then this one calling unregister.

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

Reviewed: https://review.openstack.org/354011
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=5d597367cfc89267793db0e861aa885044ac8f71
Submitter: Jenkins
Branch: master

commit 5d597367cfc89267793db0e861aa885044ac8f71
Author: Kevin Benton <email address hidden>
Date: Thu Aug 11 02:02:59 2016 -0700

    Except if tracked resource registered as countable

    If a resource was registered in the quota engine before
    being set as a tracked resource, it would have been registered
    as a CountableResource instead of a TrackedResource.

    This would cause a failure later when the resources were
    being unregistered because the quota engine thought it
    should have been a TrackedResource and tried to call
    unregister_events on it.

    This patch just prevents resources from being registered
    as both types. It also callse unregister_all_resources as
    part of the standard test case cleanup since the vast majority
    of tests are using a plugin that may register resources.

    Closes-Bug: #1612222
    Change-Id: I8a40f38d7c0e5aeca257ba62115fa9b02ad5aa93

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 9.0.0.0rc1

This issue was fixed in the openstack/neutron 9.0.0.0rc1 release candidate.

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.