Repository navigation
Commit 802429c
committed
fix: close the abandoned-probe recovery gap and bound the alert probe (#1244)
Two follow-ups to the bounded system-modal probe:
1. Recovery-path stall (review finding). After the modal probe times out,
runMainThreadWork abandons its query but that query keeps grinding on the
main thread. The plan recovers via private-AX and returns, but
executeSnapshotDispatched then ran the `didRecordXCTestFailure` bookkeeping
through another runMainThreadWork hop — which queues behind the same
abandoned query and re-stalls the command for up to the 30s execution
watchdog (or throws), reintroducing the very stall the recovery avoided. The
forced 0.5s-vs-2s validation missed it because the ~2s probe drains before
the hop waits long; the real 30-39s signature would block ~30s. Skip the
post-recovery bookkeeping while abandoned XCTest work is outstanding, the
same policy setNeedsPostSnapshotInteractionDelay already uses. Verified: the
command now completes ~180ms before the abandoned probe drains instead of
after it.
2. Sibling probe (generalization). resolveAlert runs the same SpringBoard
enumeration for the `alert` command, previously only capped by the 30s
command watchdog. Route `alert` through a bounded dispatched path
(executeAlertDispatched) that runs detection on the shared probe watchdog and
fails fast with a bounded ALERT_DETECTION_TIMED_OUT result. The snapshot and
alert dispatched paths share executeDispatchedWithRecovery (the read-only
retry + XCTest-recorded-failure invalidation the generic path gives via
executeOnMainSafely), and the bounded alert bodies keep the generic path's
Obj-C exception protection (invalidatingObjCExceptions) so a stale-element
frame/label or allElementsBoundByIndex can't escape the dispatched block.1 parent d216670 commit 802429c
3 files changed
Lines changed: 139 additions & 4 deletions
File tree
- apple-runner/AgentDeviceRunner/AgentDeviceRunnerUITests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
11 | 42 | | |
12 | | - | |
| 43 | + | |
13 | 44 | | |
14 | 45 | | |
15 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
691 | 691 | | |
692 | 692 | | |
693 | 693 | | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
694 | 700 | | |
695 | 701 | | |
696 | 702 | | |
| |||
836 | 842 | | |
837 | 843 | | |
838 | 844 | | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
839 | 863 | | |
840 | 864 | | |
841 | 865 | | |
| |||
845 | 869 | | |
846 | 870 | | |
847 | 871 | | |
848 | | - | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
849 | 885 | | |
850 | 886 | | |
851 | 887 | | |
| |||
885 | 921 | | |
886 | 922 | | |
887 | 923 | | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
888 | 992 | | |
889 | 993 | | |
890 | 994 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
| 321 | + | |
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| |||
0 commit comments