fix infinite loop when running remote tests