Skip to content

[ci] XAGCPU7000 "device offline" during -t:Install in on-device package tests #11830

Description

@simonrozsival

Summary

The emulator/device intermittently goes offline during the -t:Install step of the on-device package tests, causing error XAGCPU7000: Mono.AndroidTools.AdbException: device offline. Because the install step currently runs with continueOnError: true, the failure is swallowed, the pipeline still attempts dotnet test (which then fails with INSTRUMENTATION_FAILED since the app was never installed), and the lane is only marked red at the end by the fail if any issues occurred gate.

This is infrastructure flakiness, not a product/test regression.

Evidence

Observed on PR #11804, build 1488505 — job Package Tests > macOS > Tests > APKs 1:

Install step (build Mono.Android.NET_Tests-Debug, -t:Install):

Xamarin.Android.Common.Debugging.targets(107,2): error XAGCPU7000: Mono.AndroidTools.AdbException: device offline
   at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError(CancellationToken token)
   at Mono.AndroidTools.Adb.AdbClient.EndConnectTransport(IAsyncResult asyncResult)
   ...
Build FAILED.

Downstream run step (run Mono.Android.NET_Tests-Debug):

INSTRUMENTATION_FAILED: Mono.Android.NET_Tests/xamarin.android.runtimetests.TestInstrumentation

The Release and NoAab flavors in the same job installed and ran fine — only the Debug install caught the offline moment.

Impact

  • Flaky red PR checks unrelated to the change under test.
  • Wasted CI time: the pipeline runs dotnet test against a device where the app was never installed.

Proposed / related fix

Stop swallowing install failures: remove continueOnError: true from the -t:Install step in build-tools/automation/yaml-templates/apk-instrumentation.yaml so a failed install fails the lane immediately instead of running tests that cannot pass. (PR to follow.)

This does not fix the root cause (emulator/ADB going offline) but makes the failure fail fast and unambiguous. The underlying emulator/ADB stability issue is what this issue tracks.

Notes

XAGCPU7000 is emitted from Xamarin.Android.Common.Debugging.targets. Investigate whether a transient ADB reconnect/retry around device connect during Install would absorb these blips.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions