#4 fix deadlock of test case when expected exception is thrown.