fix timeout bugs in test cases