diff options
author | Arne Wiebalck <Arne.Wiebalck@cern.ch> | 2021-02-22 13:38:01 +0100 |
---|---|---|
committer | Ruby Loo <rloo@verizonmedia.com> | 2021-04-12 20:22:32 +0000 |
commit | 7096baea780b3f858977cbe69fb3595d58d29f67 (patch) | |
tree | 93663745222614658438379e5465a5227a02472e /ironic/tests/unit/drivers/modules/irmc/test_inspect.py | |
parent | c72df98dafcc046d70dd98a777b80e1e79c31ba6 (diff) | |
download | ironic-stable/stein.tar.gz |
Lazy-load node details from the DBstein-eolstable/stein
In order to reduce the load on the database backend, only lazy-load
a node's ports, portgroups, volume_connectors, and volume_targets.
With the power-sync as the main user, this change should reduce the
number of DB operations by two thirds roughly.
Change-Id: Id9a9a53156f7fd866d93569347a81e27c6f0673c
(cherry picked from commit 82cab603bbb21d81769cdc4f50d4fa445d026e5c)
Diffstat (limited to 'ironic/tests/unit/drivers/modules/irmc/test_inspect.py')
-rw-r--r-- | ironic/tests/unit/drivers/modules/irmc/test_inspect.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/ironic/tests/unit/drivers/modules/irmc/test_inspect.py b/ironic/tests/unit/drivers/modules/irmc/test_inspect.py index b0bd206a3..f4e67ddcd 100644 --- a/ironic/tests/unit/drivers/modules/irmc/test_inspect.py +++ b/ironic/tests/unit/drivers/modules/irmc/test_inspect.py @@ -205,24 +205,7 @@ class IRMCInspectTestCase(test_common.BaseIRMCTest): _inspect_hardware_mock.assert_called_once_with(task.node, existing_traits) - # note (naohirot): - # as of mock 1.2, assert_has_calls has a bug which returns - # "AssertionError: Calls not found." if mock_calls has class - # method call such as below: - - # AssertionError: Calls not found. - # Expected: [call.list_by_node_id( - # <oslo_context.context.RequestContext object at 0x7f1a34f8c0d0>, - # 1)] - # Actual: [call.list_by_node_id( - # <oslo_context.context.RequestContext object at 0x7f1a34f8c0d0>, - # 1)] - # - # workaround, remove class method call from mock_calls list - del port_mock.mock_calls[0] port_mock.assert_has_calls([ - # workaround, comment out class method call from expected list - # mock.call.list_by_node_id(task.context, node_id), mock.call(task.context, address=inspected_macs[0], node_id=node_id), mock.call(task.context, address=inspected_macs[1], |