Fix to wait for massive insert on unit tests