unit tests fail on mysql due to timestamp dropping microseconds

Bug #1178041 reported by Adam Young
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
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)
Changed in keystone:
assignee: nobody → Jamie Lennox (jamielennox)
Changed in keystone:
status: New → In Progress
Revision history for this message
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)
Changed in keystone:
assignee: nobody → Adam Young (ayoung)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

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)
Changed in keystone:
milestone: none → havana-1
status: Fix Committed → Fix Released
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in keystone:
milestone: havana-1 → 2013.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.