def delete_timeout(
            self, resource_client, resource_id,
            timeout=TEMPEST_CONF.data_processing.cluster_timeout):

        start = timeutils.utcnow()
        while timeutils.delta_seconds(start, timeutils.utcnow()) < timeout:
            try:
                resource_client.get(resource_id)
            except sab.APIException as sahara_api_exception:
                if 'not found' in sahara_api_exception.message:
                    return
                raise sahara_api_exception

            time.sleep(TEMPEST_CONF.data_processing.request_timeout)

        raise exceptions.TimeoutException(
            'Failed to delete resource "%s" in %d seconds.'
            % (resource_id, timeout))
dataset/ETHPy150Open openstack/sahara/sahara/tests/tempest/scenario/data_processing/client_tests/base.py/BaseDataProcessingTest.delete_timeout/original