test_provider_token_expiration_validation tests fails on slow system

Bug #1278550 reported by Brant Knudson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Brant Knudson
Icehouse
Fix Released
Undecided
Unassigned

Bug Description

The keystone.tests.test_token_provider.TestTokenProvider.test_provider_token_expiration_validation test fails on a system where it takes a long time to run the tests. The problem is that the test is expecting the token to be valid, but with the long run time and the shorter default token expiration time, the token turns out to not be valid by the time the system gets around to running the test.

The errors are like:

in output log:

{{{
...
Traceback (most recent call last):
  File "keystone/token/provider.py", line 188, in _is_valid_token
    expires_at = token_data['token']['expires']
KeyError: 'token'
...}}}

Traceback (most recent call last):
  File "keystone/tests/test_token_provider.py", line 818, in test_provider_token_expiration_validation
    self.token_provider_api._is_valid_token(SAMPLE_V2_TOKEN_VALID))
  File "keystone/token/provider.py", line 202, in _is_valid_token
    raise exception.TokenNotFound(_('Failed to validate token'))
TokenNotFound: Failed to validate token

There's probably another issue indicated here since we shouldn't be getting a KeyError in the case of an expired token.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/72467

Changed in keystone:
assignee: nobody → Brant Knudson (blk-u)
status: New → In Progress
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

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

commit f543f83e5e80f633a4696138564d70e7a2802b8f
Author: Brant Knudson <email address hidden>
Date: Mon Feb 10 14:14:25 2014 -0600

    Fix test_provider_token_expiration_validation transient failure

    The keystone.tests.test_token_provider.TestTokenProvider.
    test_provider_token_expiration_validation test would fail if the
    tests weren't run before the sample token expired. This could
    happen if the system was slow and the previous tests took a long
    time causing a potential transient failure.

    Change-Id: Ia662fcdc0cd26568fa8ea9f27d0a34cb1bfe46e6
    Closes-Bug: #1278550

Changed in keystone:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/76249

Revision history for this message
Brant Knudson (blk-u) wrote :

The previous fix didn't make all the changes required to fix the transient test failure.

Changed in keystone:
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/76249
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=170faf1468647e9a8246e6f7f157c7e5fd475ed5
Submitter: Jenkins
Branch: master

commit 170faf1468647e9a8246e6f7f157c7e5fd475ed5
Author: Brant Knudson <email address hidden>
Date: Tue Feb 25 10:12:15 2014 -0600

    Fix test_provider_token_expiration_validation transient failure

    The keystone.tests.test_token_provider.TestTokenProvider.
    test_provider_token_expiration_validation test would fail if the
    tests weren't run before the expiration period passed. This could
    happen if the system was slow and the previous tests took a long
    time causing a potential transient failure.

    Change-Id: I123aadd55770002fe1c9ed9b17669d5212198aa3
    Closes-Bug: #1278550

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: juno-1 → 2014.2
Jian Wen (wenjianhn)
tags: added: icehouse-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/139657

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (stable/icehouse)

Reviewed: https://review.openstack.org/139657
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=35d937d1e2f4a296f3475479f31e83305f0a9ed1
Submitter: Jenkins
Branch: stable/icehouse

commit 35d937d1e2f4a296f3475479f31e83305f0a9ed1
Author: Brant Knudson <email address hidden>
Date: Tue Feb 25 10:12:15 2014 -0600

    Fix test_provider_token_expiration_validation transient failure

    The keystone.tests.test_token_provider.TestTokenProvider.
    test_provider_token_expiration_validation test would fail if the
    tests weren't run before the expiration period passed. This could
    happen if the system was slow and the previous tests took a long
    time causing a potential transient failure.

    Change-Id: I123aadd55770002fe1c9ed9b17669d5212198aa3
    Closes-Bug: #1278550
    (cherry picked from commit 170faf1468647e9a8246e6f7f157c7e5fd475ed5)

tags: added: in-stable-icehouse
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.