Commit a823a2a
authored
test: exit TestRunner upon a crash instead of waiting a timeout (#373)
testRuntime() previously called wait(for:timeout:) with a single 300s
budget. If the runtime crashed (EXC_BAD_ACCESS or similar) the HTTP
POST that fulfills runtimeUnitTestsExpectation never arrived, so the
test would sit out the full 5 minutes before reporting a generic
timeout — masking crashes as slow tests in CI.
Add a 0.5s polling Timer that watches XCUIApplication.state and
fulfills the expectation when the app reaches .notRunning, recording
the exit via a didCrash flag. The Timer is registered on
RunLoop.main in .common modes so it keeps firing while XCTWaiter
spins the run loop. After the wait resolves, didCrash drives a
specific XCTFail pointing reviewers at
~/Library/Logs/DiagnosticReports/TestRunner-*.ips, while a true
timeout still surfaces as the original "exceeded N seconds" failure.
Switching the expectation from self.expectation(...) to a standalone
XCTestExpectation is required because XCTestCase tracks the former
and requires waitForExpectations; driving it through XCTWaiter
directly avoids that constraint.1 parent 5555935 commit a823a2a
1 file changed
Lines changed: 40 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
61 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
66 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
67 | 104 | | |
68 | 105 | | |
0 commit comments