← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1560437] Re: Logic of nova-cells test case 'test_cells_scheduler.test_filter_schedule_skipping' is odd

 

** Changed in: nova
       Status: In Progress => Invalid

-- 
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/1560437

Title:
  Logic of nova-cells test case
  'test_cells_scheduler.test_filter_schedule_skipping' is odd

Status in OpenStack Compute (nova):
  Invalid

Bug description:
  Logic of nova-cells test case
  'nova.tests.unit.cells.test_cells_scheduler.test_filter_schedule_skipping'[1]
  is really odd:

  def test_filter_schedule_skipping(self):
   # if a filter handles scheduling, short circuit

   def _grab(filter_properties):
    return None

   self.stubs.Set(self.scheduler, '_grab_target_cells', _grab)

   def _test(self, *args):
    raise test.TestingException("shouldn't be called")

   try:
    self.scheduler._schedule_build_to_cells(None, None, None, _test,
              None)
   except test.TestingException:
    self.fail("Scheduling did not properly short circuit")

  It uses a try-except block to ensure that '_test()' function will not
  be called during case execution, which is odd and poorly readable.

  [1]https://github.com/openstack/nova/blob/13.0.0.0rc1/nova/tests/unit/cells/test_cells_scheduler.py#L354-L369

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


References