fix(android): return from orientation once the display reports the rotation - #2356
Conversation
Size Report
Startup median (7 runs, lower is better):
|
|
The new |
88516f8 to
3104aa0
Compare
|
Addressed, rebased onto main (one commit):
Local: platform-android 645 tests, provider Android scenarios 13, root typecheck, oxlint, oxfmt, fallow (against main) clean. |
|
The bounded probe and provider scenario fixes are in place at 3104aa0. One failure path still returns success: dumpsys display runs with allowFailure, but its exit code is ignored. A failed ADB call with no orientation in stdout therefore looks like a successful probe that lacks the field. Reject failed probes through the existing ADB error handling and add a non-zero-exit regression; preserve the no-field case only for a successful probe. Android smoke also remains red at the later semantic-canary step. |
3104aa0 to
eb426b1
Compare
The first CI failure with the evidence hook (PR #2356, run 34029660070) lost its logcat section: dumping the emulator's whole 2MB buffer took longer than the 5s per-probe bound on the loaded host. The probe now reads the last 4000 lines, which holds the rotation decisions of the last minutes and returns well inside the bound.
|
The failed-display-probe handling is fixed at eb426b1: nonzero exits now fail the operation, with a dedicated regression. The live Android run passed both rotation assertions before failing at automation-press, so that failure is likely unrelated to this change. Ready for human review. |
…tation `orientation` wrote accelerometer_rotation and user_rotation and returned at once, while the display rotated some time later. On the loaded CI emulator that takes seconds, and accessibility reads hang meanwhile: the Android smoke's `wait text landscape` right after `orientation landscape-left` got a helper request timeout and then no readable capture for its whole 10s budget, with the failed-step snapshot taken afterwards already in landscape (PR #2344, run 34025424834). The command now polls `dumpsys display` for mCurrentOrientation to match the requested rotation before returning, each probe bounded by what is left of the 15s settle budget so a stuck probe ends the settle as a failure. A display that never gets there fails the command with the observed rotation instead of reporting success; a display that reports no rotation at all is left to the setting as before. The provider scenario scripts the display read against the last user_rotation write.
eb426b1 to
cfb529b
Compare
|
Addressed at cfb529b (rebased onto main, which now includes #2369):
|
|
Reviewed cfb529b. No remaining code findings. Failed orientation probes now preserve the ADB error, and the single-probe regression remains covered. Android emulator smoke and the remaining checks pass on this head. Good for human review. |
|
The first CI failure with the evidence hook (PR #2356, run 34029660070) lost its logcat section: dumping the emulator's whole 2MB buffer took longer than the 5s per-probe bound on the loaded host. The probe now reads the last 4000 lines, which holds the rotation decisions of the last minutes and returns well inside the bound.
Summary
Android
orientationwroteaccelerometer_rotationanduser_rotationand returned at once, while the display rotated some time later. On the loaded CI emulator that takes seconds, and accessibility reads hang meanwhile.Evidence: the Android Smoke on #2344, https://github.com/callstack/agent-device/actions/runs/34025424834.
wait text landscaperight afterorientation landscape-leftreportedwait_capture_stalledwith zero readable captures: the helper session request timed out at 5s, the one-shot fallback ran into the wait's deadline, and the failed-step snapshot taken right after was already in landscape (nodes 2400px wide). The rotation had landed; the wait's whole budget went to the transition.Change
setAndroidOrientationnow pollsdumpsys displayformCurrentOrientationto match the requested rotation, every 500ms up to 15s, before returning.mCurrentAppOrientation=SCREEN_ORIENTATION_NOSENSOR),orientation landscape-leftpreviously "succeeded" without rotating and now fails after 15s withobservedRotation: 0.mCurrentOrientationat all is left to the setting, as before.Validation
requestedRotation: 1, observedRotation: 0when it never does; leaves a display that reports nothing to the setting. Package suite 641 tests green; typecheck, oxlint, oxfmt, fallow clean.orientation landscape-left1s,mCurrentOrientation=1;orientation portrait1s,mCurrentOrientation=0.What this does not explain
The other Android Smoke failure family (the post-alert canary missing while the device is in landscape although
orientation portraithad been confirmed) is still open; #2350 adds the rotation evidence for it. This change removes the transition cost from the command that starts a rotation, which is also where a later flip would be visible if it is a delayed re-application.