CXX-385 Use trap to respond to test failures