_XCTestCaseInterruptionException is consumed by XCTWaiter

Originator:pohilets
Number:rdar://38906161 Date Originated:March 27 2018
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 9.2 (9C40b)
Classification:Serious Bug Reproducible:Always
 
If test failure occurs and _XCTestCaseInterruptionException is raised while execution is inside -[XCTWaiter waitForExpectations:timeout:enforceOrder:], then exception is caught and not re-thrown, preventing test interruption.

Also, _XCTestCaseImplementation.shouldIgnoreSubsequentFailures is set to YES, preventing future failures from interrupting test case.

The common problematic scenario here is when running UI test and SUT crashes.
This generates a failure, but the test is not interrupted. Test keeps executing reaching all the possible timeouts and executing all the possible re-tries. Test may continue its useless execution for hours after that.

Attached test does not include any UI testing, but reproduces the problem.

https://pastebin.com/sScdZp2d

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!