make testcase end more gracefully