← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1863707] Re: [neutron-tempest-plugin] test_trunk.TrunkTestInheritJSONBase.test_add_subport fails if unordered

 

Reviewed:  https://review.opendev.org/708305
Committed: https://git.openstack.org/cgit/openstack/neutron-tempest-plugin/commit/?id=167a5784ca42ddb225726f0b792c855a4efafc98
Submitter: Zuul
Branch:    master

commit 167a5784ca42ddb225726f0b792c855a4efafc98
Author: Cédric Ollivier <ollivier.cedric@xxxxxxxxx>
Date:   Tue Feb 18 07:42:30 2020 +0100

    Protect vs unordered results in TrunkTestInheritJSONBase
    
    Closes-Bug: #1863707
    
    Change-Id: If99de32925da9f79ceacdccc86c5727e466347c0
    Signed-off-by: Cédric Ollivier <ollivier.cedric@xxxxxxxxx>


** Changed in: neutron
       Status: In Progress => Fix Released

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

Title:
  [neutron-tempest-plugin]
  test_trunk.TrunkTestInheritJSONBase.test_add_subport fails if
  unordered

Status in neutron:
  Fix Released

Bug description:
  Tested vs OpenStack master + OVN:
  Traceback (most recent call last):
    File "/usr/lib/python3.8/site-packages/neutron_tempest_plugin/api/test_trunk.py", line 238, in test_add_subport
      self.assertEqual(expected_subports, trunk['sub_ports'])
    File "/usr/lib/python3.8/site-packages/testtools/testcase.py", line 411, in assertEqual
      self.assertThat(observed, matcher, message)
    File "/usr/lib/python3.8/site-packages/testtools/testcase.py", line 498, in assertThat
      raise mismatch_error
  testtools.matchers._impl.MismatchError: !=:
  reference = [{'port_id': '6eb624a9-368c-472c-a3ce-26608e77d2e7',
    'segmentation_id': 3,
    'segmentation_type': 'vlan'},
   {'port_id': '7a06845b-f379-4143-90f7-e664a8a602ec',
    'segmentation_id': 2,
    'segmentation_type': 'vlan'}]
  actual    = [{'port_id': '7a06845b-f379-4143-90f7-e664a8a602ec',
    'segmentation_id': 2,
    'segmentation_type': 'vlan'},
   {'port_id': '6eb624a9-368c-472c-a3ce-26608e77d2e7',
    'segmentation_id': 3,
    'segmentation_type': 'vlan'}]

  A straightforward proposal would be:
  diff --git a/neutron_tempest_plugin/api/test_trunk.py b/neutron_tempest_plugin/api/test_trunk.py
  index 823a95d..bc8ec82 100644
  --- a/neutron_tempest_plugin/api/test_trunk.py
  +++ b/neutron_tempest_plugin/api/test_trunk.py
  @@ -235,7 +235,8 @@ class TrunkTestInheritJSONBase(TrunkTestJSONBase):
                                 'segmentation_id': segmentation_id2}]
   
           # Validate that subport got segmentation details from the network
  -        self.assertEqual(expected_subports, trunk['sub_ports'])
  +        self.assertin(expected_subports[0], trunk['sub_ports'])
  +        self.assertin(expected_subports[1], trunk['sub_ports'])

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


References