Skip to content

[tests] Improve apkdiff invocation reliability - #12361

Merged
jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-diagnose-apkdiff-hang
Aug 12, 2026
Merged

jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-diagnose-apkdiff-hang

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Summary

  • cleanly reinstall the pinned .NET tool into $(Agent.ToolsDirectory), expose that directory through PATH, and fail fast if installation fails
  • run apkdiff through the shared Xamarin.Android.Tools.ProcessUtils helper
  • enable apkdiff verbose output and preserve partial stdout/stderr with a concise PID message on timeout

The intermittent Windows failure could not be reproduced directly: apkdiff 0.0.17 started but produced no output or .apkdesc before the existing 30-second timeout. This change removes stale/PATH installation ambiguity and makes a future timeout identify apkdiff's last completed operation.

Validation

  • focused Xamarin.Android.Build.Tests project build
  • apkdiff 0.0.17 smoke invocation with paths containing spaces

Copilot AI lite review requested due to automatic review settings August 12, 2026 14:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves reliability and diagnosability of the apkdiff-based size regression checks by making tool installation deterministic in CI and by running apkdiff through the shared ProcessUtils helper with verbose output and better timeout logging.

Changes:

  • Reworked CI .NET tool installation to uninstall stale copies, reinstall into $(Agent.ToolsDirectory), and prepend that directory to PATH.
  • Updated RunApkDiffCommand to execute apkdiff via Xamarin.Android.Tools.ProcessUtils.StartProcess, enabling --verbose and preserving partial output on timeout.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs Switch apkdiff execution to ProcessUtils with verbose output + timeout diagnostics.
build-tools/automation/yaml-templates/install-dotnet-tool.yaml Deterministic install/uninstall into $(Agent.ToolsDirectory) and prepend tool path to PATH.

Install the pinned tool cleanly into the agent tool directory, publish it through PATH, and fail fast when installation fails.

Use the shared Android ProcessUtils helper so apkdiff timeouts preserve verbose output and report the process ID while retaining no-window process behavior.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 588c6fbb-38c3-42b6-9903-3725ae589b4a
@jonathanpeppers
jonathanpeppers force-pushed the jonathanpeppers-diagnose-apkdiff-hang branch from 9389c34 to 5c432e7 Compare August 12, 2026 14:33
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Aug 12, 2026
@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tool installation and process invocation are deterministic and cancellation-safe, with the Windows coverage green.

@jonathanpeppers
jonathanpeppers merged commit 0e4fecd into main Aug 12, 2026
44 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-diagnose-apkdiff-hang branch August 12, 2026 17:33
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants