User credentials not being released when skipException is raised on resource_setup()

Bug #1846236 reported by Douglas Viroel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Undecided
Douglas Viroel

Bug Description

Manila tempest plugin is facing issues due to insufficient user credentials after skipping some tests. The Manila test class is raising a skipException during the resource_setup method and the credentials are not being release by the setUpClass.

Trace:
setUpClass (manila_tempest_tests.tests.api.admin.test_migration.MigrationCancelNFSTest) ... SKIPPED: ('Share migration tests are disabled.',)
setUpClass (manila_tempest_tests.tests.api.admin.test_migration.MigrationOfShareWithSnapshotNFSTest) [0.000000s] ... FAILED

'Traceback (most recent call last):'
' File "/opt/stack/new/tempest/tempest/test.py", line 213, in setUpClass'
' six.reraise(etype, value, trace)'
' File "/usr/local/lib/python3.7/dist-packages/six.py", line 693, in reraise'
' raise value'
' File "/opt/stack/new/tempest/tempest/test.py", line 196, in setUpClass'
' cls.setup_credentials()'
' File "/opt/stack/new/tempest/tempest/test.py", line 417, in setup_credentials'
' credential_type=credentials_type)'
' File "/opt/stack/new/tempest/tempest/test.py", line 722, in get_client_manager'
' creds = getattr(cred_provider, credentials_method)()'
' File "/opt/stack/new/tempest/tempest/lib/common/preprov_creds.py", line 324, in get_admin_creds'
' return self.get_creds_by_roles([self.admin_role])'
' File "/opt/stack/new/tempest/tempest/lib/common/preprov_creds.py", line 315, in get_creds_by_roles'
' net_creds = self._get_creds(roles=roles)'
' File "/opt/stack/new/tempest/tempest/lib/common/preprov_creds.py", line 248, in _get_creds'
' free_hash = self._get_free_hash(useable_hashes)'
' File "/usr/local/lib/python3.7/dist-packages/oslo_concurrency/lockutils.py", line 328, in inner'
' return f(*args, **kwargs)'
' File "/opt/stack/new/tempest/tempest/lib/common/preprov_creds.py", line 203, in _get_free_hash'
' raise lib_exc.InvalidCredentials(msg)'
'tempest.lib.exceptions.InvalidCredentials: Invalid Credentials'
'Details: Insufficient number of users provided. MigrationCancelNFSTest have allocated all the credentials for this allocation request'

The fix https://review.opendev.org/#/c/681340/6/tempest/test.py@205 seems to be capturing the exception by isn't calling the tearDownClass to cleanup() the allocated resources.

Python version: 3.7
Tempest conf: http://54.183.250.52/logs/96/685496/1/upstream-check/manila-cDOT-manila-tempest-plugin-ss/d5ed2b4/logs/tempest_conf.txt.gz
Logs: http://54.183.250.52/logs/96/685496/1/upstream-check/manila-cDOT-manila-tempest-plugin-ss/d5ed2b4/

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

Fix proposed to branch: master
Review: https://review.opendev.org/686008

Changed in tempest:
assignee: nobody → Douglas Viroel (dviroel)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.opendev.org/686008
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=7155fdfdf69dcf131742d50e61593d15c214b97b
Submitter: Zuul
Branch: master

commit 7155fdfdf69dcf131742d50e61593d15c214b97b
Author: Douglas Viroel <email address hidden>
Date: Tue Oct 1 13:34:52 2019 -0300

    Call tearDownClass when handling skip exception on setUpClass

    In setUpClass, the workaround to handle skip exception issue is
    not releasing allocated resources when a skip exception is raised
    on resource_setup.

    Change-Id: I2a5d5d60d524bd141b8ad0ffd436040906a2f36a
    Closes-Bug: #1846236

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

This issue was fixed in the openstack/tempest 22.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.