Exit mock test more gracefully