Mismatch error due to map in python3

Bug #1829475 reported by Martin Kopec
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Undecided
Martin Kopec

Bug Description

The following test is failing if it's executed by python3:
tempest.api.compute.test_extensions.ExtensionsTest.test_list_extensions

$ tox -epy36
$ source .tox/py36/bin/activate
# make sure your tempest.conf contains a list of api_extensions under [compute-feature-enabled] section. There has to be a list of extensions, not word 'all', see this if else statement [1].
$ tempest run --regex tempest.api.compute.test_extensions.ExtensionsTest.test_list_extensions

==============================
Failed 1 tests - output below:
==============================

tempest.api.compute.test_extensions.ExtensionsTest.test_list_extensions[id-3bb27738-b759-4e0d-a5fa-37d7a6df07d1]
----------------------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/centos/tempest/tempest/api/compute/test_extensions.py", line 46, in test_list_extensions'
    b' self.assertIn(ext, extension_list)'
    b' File "/home/centos/tempest/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 417, in assertIn'
    b' self.assertThat(haystack, Contains(needle), message)'
    b' File "/home/centos/tempest/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 498, in assertThat'
    b' raise mismatch_error'
    b"testtools.matchers._impl.MismatchError: 'NMN' not in <map object at 0x7f5093a75da0>"
    b''

The issue wasn't hit by the gates, because the gates have enabled all api_extensions (there is no api_extensions option under compute-feature-enabled section in their tempest.conf files, which means, 'all' extensions are enabled so the other branch of the if-else statement [1] is executed).

[1] https://github.com/openstack/tempest/blob/0557acd998254d601eead80c2a6556bca36d5959/tempest/api/compute/test_extensions.py#L43-L46

Revision history for this message
Martin Kopec (mkopec) wrote :
Changed in tempest:
assignee: nobody → Martin Kopec (mkopec)
status: New → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.opendev.org/659601
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=5511ea02037abc02cd7e91d3a7a2ea712de7be1e
Submitter: Zuul
Branch: master

commit 5511ea02037abc02cd7e91d3a7a2ea712de7be1e
Author: Martin Kopec <email address hidden>
Date: Thu May 16 15:24:00 2019 +0000

    Fix mismatch error due to map in python3

    When executed by python3 the test failed on a mismatch_error
    caused by the fact that map function works differently in
    python3.
    The review fixes the issue by rewriting the line filtering
    extensions to list comprehension.

    Closes-Bug: #1829475

    Change-Id: Ic2db882e505e7992192767acbe12a153b2d879e9

Changed in tempest:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tempest 21.0.0

This issue was fixed in the openstack/tempest 21.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.