Skip to content

CI: fail immediately when am instrument crashes instead of waiting for pipeline timeout #11136

@simonrozsival

Description

@simonrozsival

Problem

During the CoreCLRTrimmable investigation in #11091, a native crash in the test app caused am instrument to silently stop producing output. The Android MSBuild task kept waiting until the pipeline hit the 30-minute stage timeout, at which point CI reported "timeout" rather than "instrumentation crashed". This:

  1. Burns ~30 min of pipeline time per failed run.
  2. Obscures the real cause — the user has to manually dig through logcat to find the FATAL signal that happened minutes earlier.
  3. Makes triage extremely slow because the first-line error message is misleading.

Proposal

While am instrument is running, tail adb logcat in parallel and watch for:

  • FATAL EXCEPTION lines
  • tombstone written notifications
  • signal 6/signal 11 aborts in the test process
  • The test process PID disappearing from adb shell ps -A

When any of these are observed, fail the RunTestApp MSBuild task immediately with:

  • The fatal signal / exception excerpt from logcat
  • A pointer to the tombstone file on the device
  • The abbreviated native stack if available

Acceptance criteria

  • A native crash in a device test run fails the build within ~10 seconds of the crash (not ~30 minutes of timeout).
  • The first error line in the MSBuild log identifies the crash, not a timeout.
  • Existing passing tests continue to work unchanged.

Discovered during

PR #11091 — adding the CoreCLRTrimmable CI lane. Specific session where 30-min timeouts masked an instant crash in the trimmable typemap generator output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Unit TestsIssues with repo unit tests.enhancementProposed change to current functionality.needs-triageIssues that need to be assigned.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions