Make test case more robust