A note on optimal test length