unit tests fail on mysql due to timestamp dropping microseconds

Bug #1178041 reported by Adam Young on 2013-05-09
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Adam Young

Bug Description

 FAIL: test_null_expires_token (test_backend_sql.SqlToken)
Traceback (most recent call last):
File "/opt/stack/keystone/tests/test_backend.py", line 2093, in test_null_expires_token
self.assertEqual(data_ref, new_data_ref)
AssertionError: {'a': 'b', 'user_id': 'testuserid', 'expires': datetime.datetime(2013, 5, 9, 22, [truncated]... != {u'a': u'b', 'user_id': u'testuserid', 'expires': datetime.datetime(2013, 5, 9, [truncate]...
- {'a': 'b',
+ {u'a': u'b',

Adam Young (ayoung) on 2013-05-09
Changed in keystone:
assignee: nobody → Jamie Lennox (jamielennox)
Changed in keystone:
status: New → In Progress
Robert Collins (lifeless) wrote :

Hi, we had a long chat on IRC about this.

tl;dr: I think there are valid cases for large numbers of multiple tokens for the same user particularly when deploying large cluster systems - one token per node allows for granular revocation when systems fail. So I'd like to be able to deploy a 5K node cluster where each node has a keystone token - in less than 90 minutes : it is an embarassingly distributed problem

From that conversation it sounds like going back to microseconds would work well, or you could use a salt : one way to generate unique salts in a distributed environment would be to use uuidgen, or something like snowflake.

Changed in keystone:
assignee: Jamie Lennox (jamielennox) → nobody
Adam Young (ayoung) on 2013-05-09
Changed in keystone:
assignee: nobody → Adam Young (ayoung)

Reviewed: https://review.openstack.org/27878
Committed: http://github.com/openstack/keystone/commit/efc30beab10faf4720a96322adb135726662b025
Submitter: Jenkins
Branch: master

commit efc30beab10faf4720a96322adb135726662b025
Author: Jamie Lennox <email address hidden>
Date: Wed May 8 10:51:27 2013 +1000

    Allow backend & client SQL tests on mysql and pg.

    Currently the tables are not created which means that it isn't
    possible for these tests to run on anything other than sqlite.

    Fix test issues where the token id that is used to create the token is
    not the same as the id that the token is saved with.

    Fix a number of foreign key constraints issues.

    Bug 1178041

    Change-Id: Ib67eb97836e4224940abdeae4bba66748bfe4ca5

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-05-29
Changed in keystone:
milestone: none → havana-1
status: Fix Committed → Fix Released
Dolph Mathews (dolph) on 2013-09-19
Changed in keystone:
importance: Undecided → Medium
Thierry Carrez (ttx) on 2013-10-17
Changed in keystone:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers