Skip to content

fix(dev-harness): distinguish a failed Android inventory from a missing engine - #14400

Merged
Git-on-my-level merged 1 commit into
mainfrom
task/msd-harness-android-ready-inventory
Sep 17, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
task/msd-harness-android-ready-inventory

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

What changed and why

android_ready returned ready even when sdkmanager --list_installed exited nonzero, so a
failed inventory could be reported as "android emulator engine present". That is a readiness
lie: the doctor told a caller the lane was usable when it had actually failed to look.

The fix is not simply to make it strict, because reporting a definite absence when you failed
to look is the same lie inverted. There are now three distinguishable outcomes:

  • the emulator binary is missing → engine absent
  • the inventory succeeded (semicolon or slash form), or the on-disk
    system-images/android-36/google_apis/arm64-v8a tree is present, and no image is usable →
    image absent
  • sdkmanager is missing, or exited nonzero with nothing parseable and no on-disk tree →
    cannot determine, which is explicitly not a finding that the engine or image is absent

Before deciding that nonzero means broken, the actual behavior on this host was checked rather
than assumed: a healthy sdkmanager --list_installed exits 0, cmdline-tools 23 prints
deprecation warnings to stderr and slash-form paths to stdout, and JAVA_HOME=/nonexistent
still exits 0. The only nonzero reproducible was an unknown flag. So noise here does not show up
as a nonzero exit, and the doctor does not treat stderr warnings as a failed inventory — a
contributor with a working but noisy SDK is not failed.

This was found while auditing every _runner call site in the file for the teardown work, and
deliberately kept out of that change: announcing a working lane after a failed inventory is a
different class from a teardown announcing success after a failed kill.

Product invariants affected

none

How it was verified

Two tests that fail on origin/main and pass here: a nonzero inventory was reported as "engine
present", and exit-0 slash-form paths were reported as "image missing".
bash scripts/dev-harness/run-tests.sh — 326 passed. python3 scripts/check_spine_contracts.py
— 28 pending. make preflight passed. No simulator, emulator, device, or production host was
involved.

Tests

The two doctor-outcome tests above, in the harness doctor suite.

Failure class (fixes)

scripts/failure-class prepare listed three advisory candidates from scope-hint overlap —
FC-dev-harness-system-global-tool-shadows-repo-pinned,
FC-hermetic-suite-points-at-remote-api, FC-nonexecuting-verification-command — and none of
them is this contract. No new class was defined, pending the coordinator's decision.

Failure-Class: none

🤖 Generated with Claude Code

Review in cubic

… engine

sdkmanager --list_installed exiting nonzero was reported as engine present.
A missing emulator binary, a successful empty listing, and a failed look
are three different findings; cmdline-tools 23 slash paths still prove an
image is installed.

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit e66484b into main Sep 17, 2026
42 checks passed
@Git-on-my-level
Git-on-my-level deleted the task/msd-harness-android-ready-inventory branch September 17, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant