tests: removed support for OS_CHECK_PLUGIN_DEALLOCATION
AFAIU this is now bloatware not really used by anyone. It's better to clean it up to keep the code cleaner. TrivialFix Change-Id: I8ec0a086301e15820d97afde5354e4ef40356989
This commit is contained in:
parent
ec03a57614
commit
b363e78f19
|
@ -19,11 +19,9 @@
|
|||
import abc
|
||||
import contextlib
|
||||
import functools
|
||||
import gc
|
||||
import inspect
|
||||
import os
|
||||
import os.path
|
||||
import weakref
|
||||
|
||||
import eventlet.timeout
|
||||
import fixtures
|
||||
|
@ -435,24 +433,8 @@ class PluginFixture(fixtures.Fixture):
|
|||
# TODO(marun) Fix plugins that do not properly initialize notifiers
|
||||
agentschedulers_db.AgentSchedulerDbMixin.agent_notifiers = {}
|
||||
|
||||
# Perform a check for deallocation only if explicitly
|
||||
# configured to do so since calling gc.collect() after every
|
||||
# test increases test suite execution time by ~50%.
|
||||
check_plugin_deallocation = (
|
||||
bool_from_env('OS_CHECK_PLUGIN_DEALLOCATION'))
|
||||
if check_plugin_deallocation:
|
||||
plugin = weakref.ref(nm._instance.plugin)
|
||||
|
||||
nm.clear_instance()
|
||||
|
||||
if check_plugin_deallocation:
|
||||
gc.collect()
|
||||
|
||||
# TODO(marun) Ensure that mocks are deallocated?
|
||||
if plugin() and not isinstance(plugin(), mock.Base):
|
||||
raise AssertionError(
|
||||
'The plugin for this test was not deallocated.')
|
||||
|
||||
|
||||
class Timeout(fixtures.Fixture):
|
||||
"""Setup per test timeouts.
|
||||
|
|
Loading…
Reference in New Issue