Repository navigation
[tests] Report InstallAndroidDependenciesTest network outages as inconclusive - #13701
Draft
simonrozsival wants to merge 8 commits into
Draft
simonrozsival wants to merge 8 commits into
simonrozsival wants to merge 8 commits into
Conversation
Context: #13644 InstallAndroidDependenciesTest failed when the JDK download from aka.ms ended early ("The response ended prematurely"). This failure happened in all three of the test's install attempts. InstallAndroidDependencies downloaded each archive in a single request and did not check the length. DownloadAsync now checks that the response has the expected length. It retries connection failures, truncated responses, and transient HTTP status codes (408, 429, 5xx) up to 4 times with exponential backoff. Each retry resumes with an HTTP Range request when the server supports it; download.visualstudio.microsoft.com does. The existing OpenJDK signature and Android CLI SHA-256 checks still verify the result. Co-authored-by: Copilot App <[email protected]>
…downloads" This reverts commit 9a1b319.
Context: #13644 InstallAndroidDependenciesTest was flaky because the ~200 MB JDK download from aka.ms sometimes ended early ("The response ended prematurely"). It failed in all three of the test's install attempts. The test now uses the JDK that CI already provides, so the task takes its "already installed" path and the test asserts that it did. The live test still installs the Android CLI and SDK packages from scratch. The new deterministic InstallJdkExtractsArchive test covers JDK installation by extracting a local fixture archive. OpenJdkSignatureTests and UnknownJdkVersionIsNotValid already cover signature verification and URL validation without network access. Co-authored-by: Copilot App <[email protected]>
Context: #13644 The live dependency-install test must not replace a shared provisioned JDK if it is missing or too old. Pass the resolved JavaSdkDirectory explicitly, require that directory to exist, and set AndroidInstallJavaDependencies=false for both installation and the subsequent build. Assert the task skips Java installation, and correct the stale comment about downloading the JDK. Validation: the installer project builds with zero warnings/errors. An isolated MSBuild invocation using the actual installer targets, with TEST_ANDROID_JDK_PATH unset and an older fixture JDK at a path containing spaces, passes the exact JavaSdkPath, skips Java installation despite a requested version of 999.0, and leaves the fixture unchanged. Full SDK validation remains queued by the coordinator. Co-authored-by: Copilot App <[email protected]>
The project builder can delete the temporary SDK directory while saving a new project. Pass AndroidSdkDirectory explicitly so dependency installation cannot fall back to a shared SDK when that directory no longer exists. Co-authored-by: Copilot App <[email protected]>
Context: #13644 The dependency integration test requires a provisioned JDK to avoid downloading it from the network. Mark the test inconclusive when that prerequisite is absent rather than failing the test. Co-authored-by: Copilot App <[email protected]>
Keep the dependency-install change limited to the existing tests. The live test no longer verifies JDK extraction or downloading. Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the changes that reuse the provisioned JDK and isolate SDK installation.
No open issues 🎉
What changed in this PR
Reduces JDK-download-related flakiness in the Android dependency integration test tracked by #13644, while retaining Android SDK and NativeAOT NDK installation coverage.
Changes:
- Reuses the provisioned JDK and marks the test inconclusive when its directory is missing.
- Disables JDK installation and checks that the installer reports skipping it.
- Explicitly passes SDK/JDK paths to installation and build steps, limiting cleanup to the temporary SDK directory.
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs | Reuses the shared JDK without reinstalling it and keeps SDK installation isolated to the test directory. |
Review effort: Balanced
Context: #13644 Using the provisioned JDK removed the only end-to-end coverage of downloading, verifying and installing a JDK. Restore the fresh SDK/JDK install instead. Each install attempt now writes its own install-deps-N.log so earlier failures keep their diagnostics. If all three attempts fail with an HTTP transport error from the installer (HttpRequestException or HttpIOException, such as a DNS failure or truncated download), the test is inconclusive. HTTP status code failures, timeouts, verification or extraction errors, missing packages and the subsequent build still fail the test. Keep passing AndroidSdkDirectory and JavaSdkDirectory explicitly so the build cannot fall back to a shared SDK/JDK. Co-authored-by: Copilot App <[email protected]>
This was referenced Nov 23, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context: #13644
InstallAndroidDependenciesTestsometimes failed all three install attempts because downloads fromaka.msfailed, e.g.XAIAD7024: System.Net.Http.HttpIOException: The response ended prematurelyorXAIAD7000: System.Net.Http.HttpRequestException: nodename nor servname provided, or not known (aka.ms:443).The test still installs the Android SDK, the JDK and (for NativeAOT) the NDK from scratch, then builds the app with them. Changes:
install-deps-N.log, so earlier failures keep their diagnostics.HttpRequestException/HttpIOException), the test is reported as inconclusive and lists the error from each attempt. HTTP status code errors (e.g. 404), timeouts, signature or extraction errors, missing packages and build failures still fail the test.AndroidSdkDirectoryandJavaSdkDirectoryare passed explicitly, so the build cannot fall back to a shared SDK/JDK if the project builder removes the temporary directories.Validation on macOS arm64:
Xamarin.Android.Build.Tests.csproj(-t:Compileinto a temporary intermediate directory): 0 warnings, 0 errors.install-deps.logand the CIHttpIOExceptiontruncation line are classified as network failures; a realBuild Timed Out!log and an HTTP 404 line are not.InstallAndroidDependenciesTesthas not yet been run with this revision against the local SDK.