Tempest test_minimum_basic_scenario fails randomly in volume info comparison
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Invalid
|
Undecided
|
Unassigned | ||
tempest |
New
|
Undecided
|
Unassigned |
Bug Description
The bug report is based on investigation of the following Tempest job: http://
Test case
---------
Scenario test_minimum_
(http://
def test_minimum_
....
volume = self.create_
volumes = self.volumes_
self.
self.
def show_volume(self, volume):
got_volume = self.volumes_
self.
The failure is reported in the last statement where queried volume is compared with the one returned by "create_volume()" function. The only difference is in field "update_time":
reference: '2018-10-
actual: '2018-10-
The difference is 1 second.
API requests
------------
According to logs of Cinder API:
* 11:24:22.367325 - the last query from wait_for_
* 11:24:22.448961 - the query that gets volume inside of 'create_volume' function - this volume is used as reference in the test case
* 11:24:22.525480 - call 'list_volumes'
* 11:24:22.605738 - the query to get volume from 'show_volume' - this value is used in assertion to compare with the reference
Observation #1
--------------
Timestamp stored in volume object comes from the future (11:24:23.000000 vs 11:24:22.605738). The reason of this in datetime rounding that happens in MySQL (https:/
Cinder Volume logs
------------------
According to logs from c-vol:
* 11:24:22.023005 - Task 'cinder.
* 11:24:22.566680 - Volume volume-
* 11:24:22.570767 - Flow 'volume_
* 11:24:22.578602 - cinder.
Observation #2
--------------
Tempest test case assumes that the object does not change after it is reported as 'available' for the first time. However this is not the case. Function 'create_volume' from 'cinder.
updates = {'service_uuid': self.service_uuid,
As result of update operation the value stored in 'updated_at' attribute may also change if the time crosses rounding boundaries. In other words, if the first call was at 0.4 second and the second is at 0.6 then (due to MySQL rounding) the first value would become 0 and the second would turn into 1.
Summary
-------
The following is timeline that explains test failure:
* 11:24:22.448961 - Tempest requested 'reference' volume object with 'updated_at' time set to '2018-10-
* between 11:24:22.570767 and 11:24:22.578602 Cinder volume manager issued another update on volume object which turns 'updated_at' field to '2018-10-
* 11:24:22.605738 - Tempest queries 'actual' volume object which already has different 'updated_at' value.
The tempest test should handle this, either by being less precise for this field or just ignoring it.