You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9719773
Browse filesBrowse the repository at this point in the historyBrowse files
test(ios): pin the non-interactive query sweep to its tier slice through the plan
Swizzles XCUIElementQuery.allElementsBoundByIndex with a slow query and runs
a non-interactive [.querySweep] plan with a 20 s plan deadline. The sweep
must not be abandoned, and no query may start after the plan answers, so
passing the plan deadline to the sweep in either loop turns it red.
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testPrivateAXPinnedRegularDepthReachesAcquisitionAndPresentation 2>&1 | tee /tmp/agent-device-runner-regressions.log
Copy file name to clipboardExpand all lines: apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/UnitTests/RunnerTests+SnapshotCapturePlanOccupancyTests.swift
+126Lines changed: 126 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,44 @@ private final class RunnerBlockingSnapshotStub: NSObject {
26
26
}
27
27
}
28
28
29
+
/// Records when each `RunnerSlowSweepQueryStub` query started. The swizzled IMP cannot capture
30
+
/// test-local state, so each run resets it.
31
+
privateenumRunnerSlowSweepQueryGate{
32
+
/// Shorter than `flatInteractiveQueryBudget`, so a sweep that stops at its slice deadline never
33
+
/// outlives the slice; a full sweep of these outlasts the slice, so one that ignores it does.
34
+
staticletqueryDuration:TimeInterval=0.06
35
+
privatestaticletlock=NSLock()
36
+
privatestaticvarstarts:[Date]=[]
37
+
38
+
staticfuncreset(){
39
+
lock.lock()
40
+
starts=[]
41
+
lock.unlock()
42
+
}
43
+
44
+
staticfuncrecordStart(){
45
+
lock.lock()
46
+
starts.append(Date())
47
+
lock.unlock()
48
+
}
49
+
50
+
staticfuncrecordedStarts()->[Date]{
51
+
lock.lock()
52
+
defer{lock.unlock()}
53
+
returnstarts
54
+
}
55
+
}
56
+
57
+
/// Stands in for `-[XCUIElementQuery allElementsBoundByIndex]` so every query the sweep runs holds
58
+
/// the main thread for a fixed time and finds nothing.
0 commit comments