Fixing the indefinite wait in testcase.