Repository navigation
Commit eb51a88
fix(android): wait out a device-offline refusal and retry once (#3055)
* fix(android): wait out a device-offline refusal and retry once
An emulator drops to offline for a few seconds after boot while adbd
restarts. adb refuses commands on the host side then, so a helper
install could fail with 'adb: device offline'. The device-scoped
executor now waits for the device and runs the command once more.
The wait and retry stay inside the caller's timeoutMs (wait gets at
most half, 15s cap). A device that stays offline through its wait
fails fast for 30s instead of making every call wait.
* fix(android): retry only the bare host refusal, inside the remaining budget
- match only stderr that is exactly adb's device-offline refusal, empty
stdout, no timeout, so device output never triggers a rerun
- wait takes half of the remaining budget; no budget left, refusal stands
- wait uses the command's adb server and env
- timeouts and cancels keep the stayed-offline mark
- key the mark by adb server and serial
* test(android): prove the offline retry gets only the budget the wait left
The wait stub now moves the clock 1500 ms, so the retry must get 4000 - 1500 ms;
a retry given the caller's full timeout fails the test. The abort and timeout
cases assert the error they reject with. The stayed-offline key takes the
route's installed adb server first, as the route itself does.
* fix(android): key the offline retry on the classifier's typed host refusal
The adb failure classifier now records hostRefusal (adbHostRefusal on thrown
errors) when stderr is exactly the host adb's device-offline refusal, stdout is
empty, and the command did not time out. The retry keys only on that detail, so
the separate stderr predicate is gone. The broad device_offline family is
unchanged. Stayed-offline marks move to their own module, which drops lapsed
marks when it records a new one.
* refactor(android): classify each adb attempt's outcome in its own helper
attemptAdb asks isOfflineRefusalResult or isOfflineRefusalError instead of
reading the classification inline, which keeps it under the fallow
complexity threshold.
* refactor(android): keep the stayed-offline record in the adb provider scope
A separate module added one module to the eager import closure of
platform-android mechanics.ts, which failed the eager-closure budget.
---------
Co-authored-by: Michał Pierzchała <[email protected]>1 parent 0a7221d commit eb51a88
5 files changed
Lines changed: 471 additions & 25 deletions
File tree
- packages/platform-android/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
498 | | - | |
| 498 | + | |
499 | 499 | | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
508 | 509 | | |
509 | 510 | | |
510 | 511 | | |
| |||
521 | 522 | | |
522 | 523 | | |
523 | 524 | | |
| 525 | + | |
| 526 | + | |
524 | 527 | | |
525 | 528 | | |
526 | 529 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
26 | 58 | | |
27 | 59 | | |
28 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
27 | 43 | | |
28 | 44 | | |
29 | 45 | | |
| |||
32 | 48 | | |
33 | 49 | | |
34 | 50 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 51 | + | |
43 | 52 | | |
44 | 53 | | |
45 | 54 | | |
| |||
126 | 135 | | |
127 | 136 | | |
128 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
129 | 141 | | |
130 | 142 | | |
131 | 143 | | |
| |||
141 | 153 | | |
142 | 154 | | |
143 | 155 | | |
144 | | - | |
| 156 | + | |
| 157 | + | |
145 | 158 | | |
146 | 159 | | |
147 | 160 | | |
| |||
154 | 167 | | |
155 | 168 | | |
156 | 169 | | |
| 170 | + | |
157 | 171 | | |
158 | 172 | | |
159 | 173 | | |
| |||
0 commit comments