Add wait to permalink test