fix(scripts): device-testing harness portability + robustness (file-based dump, UTF-8 I/O, breadcrumb readiness, row-selection) #392

Closed
opened 2026-07-07 00:26:53 +00:00 by JMR-dev · 1 comment
JMR-dev commented 2026-07-07 00:26:53 +00:00 (Migrated from github.com)

Context

On-device perf run 2026-07-06 on a Pixel 8 Pro (husky) from Windows surfaced portability + robustness gaps in scripts/device-testing/ (originally validated on a Pixel 10 Pro XL). Worked around this run via a scratchpad shim (no repo change) — should be fixed in the harness so it runs cross-device/OS without a shim.

Issues

  1. uiautomator dump /dev/tty returns only the status line on this device (no XML on stdout) -> every UI-driven scenario skipped all samples. Fix: use a file-based dump (uiautomator dump /sdcard/window_dump.xml then adb ... cat) as the primary/fallback path.
  2. Windows encoding: adb.py's subprocess.run(text=True) decodes as cp1252 -> UnicodeDecodeError on the UTF-8 dump XML; perf_harness's print() -> UnicodeEncodeError on emoji subjects. Fix: force UTF-8 decode for adb I/O + PYTHONUTF8=1 / UTF-8 console.
  3. Readiness signal: message-open readiness relies on UI polling, which misfires (a 150s "open timed out" was an atypical row that never matched — no message actually opened). Use the MailReader openMessage breadcrumb (#358, already emitted) as the readiness signal instead of/alongside UI polling.
  4. Row-selection: skip non-message rows (e.g. a row whose only text is the account email) so scenarios don't pick a non-openable row.

Acceptance

Harness runs its UI-driven scenarios on a Pixel 8 Pro + Windows without a shim; message-open keys off the breadcrumb; no encoding crashes. Relates to #370 (the harness). Evidence: scratchpad\harness-results.

## Context On-device perf run 2026-07-06 on a **Pixel 8 Pro (husky) from Windows** surfaced portability + robustness gaps in `scripts/device-testing/` (originally validated on a Pixel 10 Pro XL). Worked around this run via a scratchpad shim (no repo change) — should be fixed in the harness so it runs cross-device/OS without a shim. ## Issues 1. **`uiautomator dump /dev/tty` returns only the status line** on this device (no XML on stdout) -> every UI-driven scenario skipped all samples. Fix: use a **file-based dump** (`uiautomator dump /sdcard/window_dump.xml` then `adb ... cat`) as the primary/fallback path. 2. **Windows encoding:** `adb.py`'s `subprocess.run(text=True)` decodes as cp1252 -> `UnicodeDecodeError` on the UTF-8 dump XML; `perf_harness`'s `print()` -> `UnicodeEncodeError` on emoji subjects. Fix: force **UTF-8** decode for adb I/O + `PYTHONUTF8=1` / UTF-8 console. 3. **Readiness signal:** message-open readiness relies on UI polling, which misfires (a 150s "open timed out" was an atypical row that never matched — no message actually opened). Use the **`MailReader openMessage` breadcrumb** (#358, already emitted) as the readiness signal instead of/alongside UI polling. 4. **Row-selection:** skip non-message rows (e.g. a row whose only text is the account email) so scenarios don't pick a non-openable row. ## Acceptance Harness runs its UI-driven scenarios on a Pixel 8 Pro + Windows without a shim; message-open keys off the breadcrumb; no encoding crashes. Relates to #370 (the harness). Evidence: scratchpad\harness-results\.
JMR-dev commented 2026-07-07 02:12:57 +00:00 (Migrated from github.com)

Subsumed by #405 — the harness refactor to the proven cold-fetch pause-hook A/B flow folds in these portability fixes (file-based dump, UTF-8 I/O, breadcrumb readiness, row-selection). Consolidating to avoid overlapping work.

Subsumed by #405 — the harness refactor to the proven cold-fetch pause-hook A/B flow folds in these portability fixes (file-based dump, UTF-8 I/O, breadcrumb readiness, row-selection). Consolidating to avoid overlapping work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMail#392