The stub in this test was changing local_path of the snapshot each time self.driver.local_path() was called. LVMVolumeDriver._clear_volume() does a path exists check on local_path(snapshot), which would sometimes fail because the local_path() would right then and there create a new temp file and change the path again. While this should be synchronous, my guess is there is no acknowledgement this is done and sometimes the drive couldn't keep up, so the file wouldn't be there.
The stub in this test was changing local_path of the snapshot each time self.driver. local_path( ) was called. LVMVolumeDriver ._clear_ volume( ) does a path exists check on local_path( snapshot) , which would sometimes fail because the local_path() would right then and there create a new temp file and change the path again. While this should be synchronous, my guess is there is no acknowledgement this is done and sometimes the drive couldn't keep up, so the file wouldn't be there.
https:/ /github. com/openstack/ cinder/ blob/bcd9f363ff 8a10ff30795c54f 471a8c6d76450fe /cinder/ tests/api/ contrib/ test_admin_ actions. py#L294
https:/ /github. com/openstack/ cinder/ blob/bcd9f363ff 8a10ff30795c54f 471a8c6d76450fe /cinder/ tests/api/ contrib/ test_admin_ actions. py#L294