Skip to content

Enable Android dependency install test retries - #12059

Merged
jonathanpeppers merged 3 commits into
mainfrom
copilot/fix-install-android-dependencies-test
Jul 23, 2026
Merged

jonathanpeppers merged 3 commits into
mainfrom
copilot/fix-install-android-dependencies-test

Conversation

Copilot AI commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

InstallAndroidDependenciesTest retries transient SDK/JDK download failures, but ProjectBuilder throws on the first failed build, preventing later attempts.

  • Retry behavior
    • Disable ThrowOnBuildFailure for this test’s builder.
    • Preserve the existing three-attempt loop, cleanup, delay, and final assertion.
b.CleanupAfterSuccessfulBuild = false;
b.ThrowOnBuildFailure = false;

Copilot AI changed the title [WIP] Fix flaky test for InstallAndroidDependenciesTest Enable Android dependency install test retries Jul 13, 2026
Copilot AI requested a review from simonrozsival July 13, 2026 20:35
@simonrozsival
simonrozsival marked this pull request as ready for review July 14, 2026 15:34
Copilot AI review requested due to automatic review settings July 14, 2026 15:34
@simonrozsival

Copy link
Copy Markdown
Member

/review

@github-actions

github-actions Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

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

This PR fixes the retry behavior of InstallAndroidDependenciesTest by ensuring the test can observe build failures as false return values (instead of exceptions), allowing its existing retry loop to function as intended when SDK/JDK downloads fail transiently in CI.

Changes:

  • Disable ProjectBuilder.ThrowOnBuildFailure for InstallAndroidDependenciesTest so the three-attempt retry loop can continue after a failed build.
Show a summary per file
File Description
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs Sets ThrowOnBuildFailure = false so transient dependency install failures don’t abort the retry loop via exceptions.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@github-actions github-actions Bot 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.

✅ LGTM

Verdict: ✅ LGTM — Clean, minimal, correct fix.

Summary

The one-line change (b.ThrowOnBuildFailure = false;) is exactly what the retry loop needs. Previously, ProjectBuilder.Build throws FailedBuildException on the first failed build (Builder.cs:414), which aborted the three-attempt loop before it could retry transient SDK/JDK download failures. Disabling ThrowOnBuildFailure lets b.Build(...) return false, so the loop's cleanup + delay + retry logic works as intended, and the final Assert.IsTrue (installSucceeded, ...) still fails the test if all attempts fail.

Issue counts: ❌ 0 · ⚠️ 0 · 💡 1

Verification

  • ✅ Retry loop (lines 76–92) now functions correctly across all 3 attempts.
  • ✅ Final assertion still enforces success.
  • ✅ The final default-target build (line 121) remains guarded by Assert.IsTrue, so disabling throw-on-failure for the whole builder doesn't mask a real failure there.
  • ✅ Change is scoped to a single test; no production code affected.

Positive callouts

  • Good use of a clear code comment referencing the tracking issue (#11973).
  • Cleanup-per-attempt (deleting/recreating sdkPath/jdkPath) correctly avoids partial-download contamination between retries.

Nice, focused change.

Generated by Android PR Reviewer for #12059 · 65.1 AIC · ⌖ 18.5 AIC · ⊞ 6.8K
Comment /review to run again

@jonathanpeppers jonathanpeppers 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.

We should re-enable the ignored test in main, if this is really the fix.

Copilot AI and others added 3 commits July 20, 2026 09:09
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: e0993a88-da38-49ca-b07c-207f4f3d470c
@jonathanpeppers
jonathanpeppers force-pushed the copilot/fix-install-android-dependencies-test branch from 8e2773a to 29c22b9 Compare July 20, 2026 14:16
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jul 22, 2026
@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) July 22, 2026 18:48
@jonathanpeppers
jonathanpeppers merged commit de512b6 into main Jul 23, 2026
45 checks passed
@jonathanpeppers
jonathanpeppers deleted the copilot/fix-install-android-dependencies-test branch July 23, 2026 06:12
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 22, 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.

[Flaky test] InstallAndroidDependenciesTest (GoogleV2/Xamarin, CoreCLR) fails intermittently across PRs

5 participants