def test_destroy_timesout(self):
        new_volume = self.api.create_volume(
            dataset_id=uuid4(),
            size=get_minimum_allocatable_size(),
        )

        expected_timeout = 8
        # Using a fake no-op delete so it doesn't actually delete anything
        # (we don't need any actual volumes here, as we only need to verify
        # the timeout)
        self.patch(
            self.api.cinder_volume_manager,
            "delete",
            lambda *args, **kwargs: None
        )

        # Now try to delete it
        time_module = FakeTime(initial_time=0)
        self.patch(self.api, "_time", time_module)
        self.patch(self.api, "_timeout", expected_timeout)

        exception = self.assertRaises(
            TimeoutException,
            self.api.destroy_volume,
            blockdevice_id=new_volume.blockdevice_id,
        )

        self.assertEqual(
            expected_timeout,
            exception.elapsed_time
        )

        self.assertEqual(
            expected_timeout,
            time_module._current_time
        )
If Cinder does not delete the volume within a specified amount of time,
dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/agents/functional/test_cinder.py/BlockDeviceAPIDestroyTests.test_destroy_timesout