XCTest Crash Demo
This repo intends to centralize XCTest crash errors and the way they can be reproduced in order to help developers to understand them.
1.- Early unexpected exit
XCTestCrash (67172) encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying Error: Test crashed with signal trap before starting test execution.
This happens when the App Host crashes, you can reproduce it by uncommenting
crash2() functions in
ViewController.swift and executing
2.- Restarting after unexpected exit
Restarting after unexpected exit, crash, or test timeout in XCTestCrashTests.testExample(); summary will include totals from previous launches.
This happens when a Test Case crashes, you can reproduce it by uncommenting
XCTestCrashTests.swift and executing
Of course the best solution is to solve the crash but the error messages doesn’t add too much information where it is.
A possible solution is to search in the
directory the last crash report and export it, this is the script we are using to search the latest (up to 30 segs ago) that contains the
SCHEME var name.
find $HOME/Library/Logs/DiagnosticReports -type f -mtime -30s -name "$SCHEME*.ips" -print0 | \ xargs -0 stat -f "%m %N" | \ sort -rn | \ head -1 | \ cut -f2- -d" "