Fix unittest race