This test looks very brittle, i think it is very likely to fail if some threads complete fast before the loop is done