Skip to content

Enable Android dependency install test retries#12059

Open
simonrozsival with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-install-android-dependencies-test
Open

Enable Android dependency install test retries#12059
simonrozsival with Copilot wants to merge 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: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

4 participants