fix race in scheduler test