passed in duration and test flag