← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1436424] [NEW] Test case fails intermittently in assetEqual on list

 

Public bug reported:


I'm seeing the following test case failure intermittently: 

======================================================================
FAIL: glance.tests.unit.test_db.TestImageRepo.test_list_with_checksum_filter_multiple_images
tags: worker-0
----------------------------------------------------------------------
Traceback (most recent call last):
  File "glance/tests/unit/test_db.py", line 265, in test_list_with_checksum_filter_multiple_images
    self.assertEqual([UUID3, UUID2], image_ids)
  File "/home/jenkins/workspace/osee-glance-merge/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 350, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/home/jenkins/workspace/osee-glance-merge/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 435, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = ['971ec09a-8067-4bc8-a91f-ae3557f1c4c7',
 'a85abd86-55b3-4d5b-b0b4-5d0a6e6042fc']
actual    = ['a85abd86-55b3-4d5b-b0b4-5d0a6e6042fc',
 '971ec09a-8067-4bc8-a91f-ae3557f1c4c7']

Looking at the code:

    def test_list_with_checksum_filter_multiple_images(self):
        filters = {'checksum': CHCKSUM1}
        images = self.image_repo.list(filters=filters)
        image_ids = list([i.image_id for i in images])
        self.assertEqual(2, len(image_ids))
        self.assertEqual([UUID3, UUID2], image_ids)

I think that either the lists need to be sorted or assertIn used to
check for UUID3 and UUID2 instead.

** Affects: glance
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1436424

Title:
  Test case fails intermittently in assetEqual on list

Status in OpenStack Image Registry and Delivery Service (Glance):
  New

Bug description:
  
  I'm seeing the following test case failure intermittently: 

  ======================================================================
  FAIL: glance.tests.unit.test_db.TestImageRepo.test_list_with_checksum_filter_multiple_images
  tags: worker-0
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "glance/tests/unit/test_db.py", line 265, in test_list_with_checksum_filter_multiple_images
      self.assertEqual([UUID3, UUID2], image_ids)
    File "/home/jenkins/workspace/osee-glance-merge/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 350, in assertEqual
      self.assertThat(observed, matcher, message)
    File "/home/jenkins/workspace/osee-glance-merge/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 435, in assertThat
      raise mismatch_error
  testtools.matchers._impl.MismatchError: !=:
  reference = ['971ec09a-8067-4bc8-a91f-ae3557f1c4c7',
   'a85abd86-55b3-4d5b-b0b4-5d0a6e6042fc']
  actual    = ['a85abd86-55b3-4d5b-b0b4-5d0a6e6042fc',
   '971ec09a-8067-4bc8-a91f-ae3557f1c4c7']

  Looking at the code:

      def test_list_with_checksum_filter_multiple_images(self):
          filters = {'checksum': CHCKSUM1}
          images = self.image_repo.list(filters=filters)
          image_ids = list([i.image_id for i in images])
          self.assertEqual(2, len(image_ids))
          self.assertEqual([UUID3, UUID2], image_ids)

  I think that either the lists need to be sorted or assertIn used to
  check for UUID3 and UUID2 instead.

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


Follow ups

References