def METHOD_NAME(self):
    # Wait until file is available
    r = self.client()
    while True:
        info = r.info('persistence')
        if info['aof_rewrite_scheduled'] or info['aof_rewrite_in_progress']:
            time.sleep(0.1)
        else:
            break