Merge "Stop resource leakage for negative tests"