TestTrackedResource.test_resync failed with AttributeError: 'NoneType' object has no attribute '_get_collection_query'

Bug #1677636 reported by Ihar Hrachyshka
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Ihar Hrachyshka

Bug Description

http://logs.openstack.org/18/442518/11/gate/neutron-coverage-ubuntu-xenial/e0c4f27/console.html

2017-03-30 11:30:54.119979 | Traceback (most recent call last):
2017-03-30 11:30:54.120013 | File "neutron/tests/base.py", line 116, in func
2017-03-30 11:30:54.120036 | return f(self, *args, **kwargs)
2017-03-30 11:30:54.120070 | File "neutron/tests/unit/quota/test_resource.py", line 255, in test_resync
2017-03-30 11:30:54.120091 | res.mark_dirty(self.context)
2017-03-30 11:30:54.120120 | File "neutron/quota/resource.py", line 190, in mark_dirty
2017-03-30 11:30:54.120151 | quota_api.set_quota_usage_dirty(context, self.name, tenant_id)
2017-03-30 11:30:54.120177 | File "neutron/db/api.py", line 163, in wrapped
2017-03-30 11:30:54.120199 | return method(*args, **kwargs)
2017-03-30 11:30:54.120266 | File "/home/jenkins/workspace/neutron-coverage-ubuntu-xenial/.tox/cover/local/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 963, in wrapper
2017-03-30 11:30:54.120302 | return fn(*args, **kwargs)
2017-03-30 11:30:54.120338 | File "neutron/db/quota/api.py", line 119, in set_quota_usage_dirty
2017-03-30 11:30:54.120366 | context, resource=resource, project_id=tenant_id)
2017-03-30 11:30:54.120394 | File "neutron/objects/base.py", line 425, in get_object
2017-03-30 11:30:54.120417 | **cls.modify_fields_to_db(kwargs)
2017-03-30 11:30:54.120446 | File "neutron/objects/db/api.py", line 32, in get_object
2017-03-30 11:30:54.120476 | return _get_filter_query(context, model, **kwargs).first()
2017-03-30 11:30:54.120506 | File "neutron/objects/db/api.py", line 27, in _get_filter_query
2017-03-30 11:30:54.120542 | query = plugin._get_collection_query(context, model, filters)
2017-03-30 11:30:54.120580 | AttributeError: 'NoneType' object has no attribute '_get_collection_query'

Changed in neutron:
status: New → Confirmed
importance: Undecided → High
tags: added: gate-failure unittest
Changed in neutron:
assignee: nobody → Ihar Hrachyshka (ihar-hrachyshka)
Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :
Revision history for this message
Brian Haley (brian-haley) wrote :
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/451934

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

Reviewed: https://review.openstack.org/451934
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=8a0faef877a18d931178a2ed1d55734aa91e32d3
Submitter: Jenkins
Branch: master

commit 8a0faef877a18d931178a2ed1d55734aa91e32d3
Author: Ihar Hrachyshka <email address hidden>
Date: Thu Mar 30 15:56:29 2017 +0000

    TestTrackedResource: register core plugin in directory

    This is achieved by switching the test class to BaseTestCase and using
    setup_coreplugin. This makes later calls to neutron.objects.db.api
    functions that extract the plugin from plugins directory to work.

    The test class registers some sqlalchemy events for models not
    registered in BASEV2, which later makes unregister_events fail because
    of failure to compare those model classes with other registered model
    classes (those that belong to proper model classes like Port). Before
    the patch, the core plugin was not correctly registered in plugins
    directory, and no code was actually loading the plugin, so no other
    sqla events were in _REGISTERED_SQLA_EVENTS, which explains why
    previously calls to unregister_events hasn't failed.

    Good news is that the new parent class does clean up all events itself,
    so we don't need to set the cleanup hook ourselves.

    This switch also facilitated removal of some other preparatory steps
    from the class that are already implemented in the new parent.

    Closes-Bug: #1677636
    Change-Id: Id462e532066ac3cd5e2f76c3670da7f7820c6581

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

This issue was fixed in the openstack/neutron 11.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.