Make timeout test more reliable