test infinite loop handling