← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1912167] [NEW] Mistake in unit test: test_get_pinning_isolate_policy_bug_1889633

 

Public bug reported:

Description
===========

objects.InstanceNUMACell don't get pcpuset attribute

In test_get_pinning_isolate_policy_bug_1889633 objects.InstanceNUMACell
has cpuset and pcpuset passed to constructor. Only cpuset is valid but
has wrong value (it should have cpu to pin if pinning is required).

This test may confuse developers that pcpuset is available for
objects.InstanceNUMACell and It may not pass on custom code that require
proper cpuset value.


diff --git a/nova/tests/unit/virt/test_hardware.py b/nova/tests/unit/virt/test_hardware.py
index 8e6c049f04..5a153f7480 100644
--- a/nova/tests/unit/virt/test_hardware.py
+++ b/nova/tests/unit/virt/test_hardware.py
@@ -3247,8 +3247,7 @@ class CPUPinningCellTestCase(test.NoDBTestCase, _CPUPinningTestCaseBase):
             mempages=[],
         )
         inst_pin = objects.InstanceNUMACell(
-            cpuset=set(),
-            pcpuset={0, 1},
+            cpuset={0, 1},
             memory=2048,
             cpu_policy=fields.CPUAllocationPolicy.DEDICATED,
             cpu_thread_policy=fields.CPUThreadAllocationPolicy.ISOLATE,

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1912167

Title:
  Mistake in unit test: test_get_pinning_isolate_policy_bug_1889633

Status in OpenStack Compute (nova):
  New

Bug description:
  Description
  ===========

  objects.InstanceNUMACell don't get pcpuset attribute

  In test_get_pinning_isolate_policy_bug_1889633
  objects.InstanceNUMACell has cpuset and pcpuset passed to constructor.
  Only cpuset is valid but has wrong value (it should have cpu to pin if
  pinning is required).

  This test may confuse developers that pcpuset is available for
  objects.InstanceNUMACell and It may not pass on custom code that
  require proper cpuset value.

  
  diff --git a/nova/tests/unit/virt/test_hardware.py b/nova/tests/unit/virt/test_hardware.py
  index 8e6c049f04..5a153f7480 100644
  --- a/nova/tests/unit/virt/test_hardware.py
  +++ b/nova/tests/unit/virt/test_hardware.py
  @@ -3247,8 +3247,7 @@ class CPUPinningCellTestCase(test.NoDBTestCase, _CPUPinningTestCaseBase):
               mempages=[],
           )
           inst_pin = objects.InstanceNUMACell(
  -            cpuset=set(),
  -            pcpuset={0, 1},
  +            cpuset={0, 1},
               memory=2048,
               cpu_policy=fields.CPUAllocationPolicy.DEDICATED,
               cpu_thread_policy=fields.CPUThreadAllocationPolicy.ISOLATE,

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1912167/+subscriptions


Follow ups