wait_for raises an error if the job fails