Random loop test