test_list_get_volume_attachments calling detach volume twice but failed to receive the right exception in the second call

Bug #1720044 reported by Guy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
New
Undecided
Unassigned

Bug Description

In this test, we attach the volume to an instance and detach it after.
There are two calls of detaching the volume:
- first call is done by the test (https://github.com/openstack/tempest/blob/master/tempest/api/compute/volumes/test_attach_volume.py#L146)
- second call is done by a cleanup at the end of the tests ( self.addCleanup(test_utils.call_and_ignore_notfound_exc,
)

The first call for detaching the volume is a success. But the second call returns this error: "{"badRequest": {"message": "Invalid volume: Invalid input received: Invalid volume: Unable to detach volume. Volume status must be 'in-use' and attach_status must be 'attached' to detach. (HTTP 400) (Request-ID: req-f7a17aff-cbed-4203-a6a1-65635a39b878)", "code": 400}}"

We hit the issue in our third party CI running for Cinder.

The second call will call the method "call_ignore_not_found_exc" (https://github.com/openstack/tempest/blob/master/tempest/lib/common/utils/test_utils.py#L81). If it receives a "NotFound" exception from the rest client, the second call for detaching the volume is skipped.

In our CI, it doesn't receive this exception because the rest client raises BadRequest exception (400) instead of NotFound (404).

The complete logs of the tests can be found here (http://188.166.245.68/67/504467/5/check/dsvm-tempest-ITRI-DISCO-cinder-driver/c0a5799//logs/testr_results.html.gz)

Guy (guy-kim088)
summary: test_list_get_volume_attachments calling detach volume twice but failed
- to receive the exception in the second call
+ to receive the right exception in the second call
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :
Revision history for this message
Guy (guy-kim088) wrote :

Ok thank you for the link of the fix. I close this bug since it is a duplicated one.

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.