partially working failing test inifinite loop exception