order of user list appears inconsistent

Bug #1332831 reported by Dolph Mathews
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Priti Desai

Bug Description

This appeared as a transient failure in a doc change. I suspect the test shouldn't bother asserting the order of the results, only that the expected values appear in the list.

======================================================================
FAIL: keystone.tests.test_v2_controller.TenantTestCase.test_get_project_users_no_user
tags: worker-1
----------------------------------------------------------------------
Empty attachments:
  pythonlogging:''-1
  stderr
  stdout

pythonlogging:'': {{{
Adding cache-proxy 'keystone.tests.test_cache.CacheIsolatingProxy' to backend.
KVS region configuration for token-driver: {'keystone.kvs.arguments.distributed_lock': True, 'keystone.kvs.backend': 'openstack.kvs.Memory', 'keystone.kvs.arguments.lock_timeout': 6}
Using default dogpile sha1_mangle_key as KVS region token-driver key_mangler
It is recommended to only use the base key-value-store implementation for the token driver for testing purposes. Please use keystone.token.backends.memcache.Token or keystone.token.backends.sql.Token instead.
KVS region configuration for os-revoke-driver: {'keystone.kvs.arguments.distributed_lock': True, 'keystone.kvs.backend': 'openstack.kvs.Memory', 'keystone.kvs.arguments.lock_timeout': 6}
Using default dogpile sha1_mangle_key as KVS region os-revoke-driver key_mangler
Callback: `keystone.contrib.revoke.core.Manager._trust_callback` subscribed to event `identity.OS-TRUST:trust.deleted`.
Callback: `keystone.contrib.revoke.core.Manager._consumer_callback` subscribed to event `identity.OS-OAUTH1:consumer.deleted`.
Callback: `keystone.contrib.revoke.core.Manager._access_token_callback` subscribed to event `identity.OS-OAUTH1:access_token.deleted`.
Callback: `keystone.contrib.revoke.core.Manager._role_callback` subscribed to event `identity.role.deleted`.
Callback: `keystone.contrib.revoke.core.Manager._user_callback` subscribed to event `identity.user.deleted`.
Callback: `keystone.contrib.revoke.core.Manager._user_callback` subscribed to event `identity.user.disabled`.
Callback: `keystone.contrib.revoke.core.Manager._project_callback` subscribed to event `identity.project.deleted`.
Callback: `keystone.contrib.revoke.core.Manager._project_callback` subscribed to event `identity.project.disabled`.
Callback: `keystone.contrib.revoke.core.Manager._domain_callback` subscribed to event `identity.domain.disabled`.
found extension EntryPoint.parse('qpid = oslo.messaging._drivers.impl_qpid:QpidDriver')
found extension EntryPoint.parse('zmq = oslo.messaging._drivers.impl_zmq:ZmqDriver')
found extension EntryPoint.parse('kombu = oslo.messaging._drivers.impl_rabbit:RabbitDriver')
found extension EntryPoint.parse('rabbit = oslo.messaging._drivers.impl_rabbit:RabbitDriver')
found extension EntryPoint.parse('fake = oslo.messaging._drivers.impl_fake:FakeDriver')
found extension EntryPoint.parse('log = oslo.messaging.notify._impl_log:LogDriver')
found extension EntryPoint.parse('messagingv2 = oslo.messaging.notify._impl_messaging:MessagingV2Driver')
found extension EntryPoint.parse('noop = oslo.messaging.notify._impl_noop:NoOpDriver')
found extension EntryPoint.parse('routing = oslo.messaging.notify._impl_routing:RoutingDriver')
found extension EntryPoint.parse('test = oslo.messaging.notify._impl_test:TestDriver')
found extension EntryPoint.parse('messaging = oslo.messaging.notify._impl_messaging:MessagingDriver')
User 70bb7abd662a42c4b906cfc16c907fcf in project bar doesn't exist.
}}}

Traceback (most recent call last):
  File "keystone/tests/test_v2_controller.py", line 61, in test_get_project_users_no_user
    self.assertEqual(orig_project_users, new_project_users)
  File "/home/jenkins/workspace/gate-keystone-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 321, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/home/jenkins/workspace/gate-keystone-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 406, in assertThat
    raise mismatch_error
MismatchError: !=:
reference = {'users': [{'email': '<email address hidden>',
            'enabled': True,
            'id': 'd00764bbd27f478c8321af4fcd1428fb',
            'name': 'FOO',
            'username': 'FOO'},
           {'email': '<email address hidden>',
            'enabled': True,
            'id': 'ee5f3d2c210e481198f68b0b53518838',
            'name': 'SNA',
            'username': 'SNA'}]}
actual = {'users': [{'email': '<email address hidden>',
            'enabled': True,
            'id': 'ee5f3d2c210e481198f68b0b53518838',
            'name': 'SNA',
            'username': 'SNA'},
           {'email': '<email address hidden>',
            'enabled': True,
            'id': 'd00764bbd27f478c8321af4fcd1428fb',
            'name': 'FOO',
            'username': 'FOO'}]}

Tags: transient
Dolph Mathews (dolph)
description: updated
tags: added: transient
Changed in keystone:
assignee: nobody → Priti Desai (priti-desai)
Changed in keystone:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/101712
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=7b339d1ff85ba7819e60459bdded48019ea9bd56
Submitter: Jenkins
Branch: master

commit 7b339d1ff85ba7819e60459bdded48019ea9bd56
Author: Priti Desai <email address hidden>
Date: Sat Jun 21 17:34:45 2014 +0000

    Ignoring order of user list in TenantTestCase

    keystone.tests.test_v2_controller.TenantTestCase.
    test_get_project_users_no_user should not bother asserting
    the order of the results, only that the expected values appear in the list.
    Replacing self.assertEqual(orig_project_users, new_project_users)
    with self.assertEqual(sorted(orig_project_users), sorted(new_project_users))
    Better option would be assertItemsEqual but its only available in 2.7 and later.

    Closes-bug: #1332831
    Change-Id: I09842e0375dc0fa8908241498e1cc794e04d992c

Changed in keystone:
status: In Progress → Fix Committed
Changed in keystone:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: juno-2 → 2014.2
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.