]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Ensure core plugin deallocation after every test
authorMaru Newby <marun@redhat.com>
Wed, 7 May 2014 22:41:40 +0000 (22:41 +0000)
committerMaru Newby <marun@redhat.com>
Fri, 9 May 2014 06:40:46 +0000 (23:40 -0700)
commit6db48dd688d45ba41863926fa1a91d2d3ea484ec
tree357b90577a5b3a56e3e428012afbed7d3a3f06d4
parentba4571369ef7ccb47a256bd3f317e09ac98c4bc0
Ensure core plugin deallocation after every test

The unit tests were previously consuming an excessive amount of memory
(4GB+) due to plugin instances persisting in memory.  Deallocation was
not possible where a combination of circular references and mocking
was involved.  This patch ensures that only NeutronManager holds a
plugin reference and that all other references are instances of
weakref.proxy.  Residual memory footprint for tox executed on a
12-core machine has been reduced to ~1.3GB.  Plugin deallocation is
validated at the end of each test to prevent regressions.

This change also includes fixes to unit tests that depended on plugin
instances persisting across tests.

Partial-Bug: #1234857
Change-Id: Ia1f868c2d206eb72ef77d290d054f3c48ab58c94
neutron/db/db_base_plugin_v2.py
neutron/manager.py
neutron/plugins/nec/nec_plugin.py
neutron/plugins/ryu/ryu_neutron_plugin.py
neutron/tests/base.py
neutron/tests/unit/ml2/test_mechanism_odl.py
neutron/tests/unit/ml2/test_ml2_plugin.py
neutron/tests/unit/test_db_plugin.py