Skip to content

Commit afc0358

Browse files
authored
[Xamarin.Android.Build.Tests] Retry MissingOrgApacheHttpClient. (#5717)
The `MissingOrgApacheHttpClient` test seems to fail on a regular basis. This is probably down to networking issues, so we should retry this test a few times just in case. Additionally, use `$(XamarinBuildDownloadDir)` to a local folder in the test: https://github.com/xamarin/XamarinComponents/blob/4f5a57bd567f46f4b67622ab718b50485725463f/Util/Xamarin.Build.Download/source/Xamarin.Build.Download/Xamarin.Build.Download.targets#L9 This way if the test needs to retry, it starts with a fresh directory.
1 parent a02084e commit afc0358

File tree

1 file changed

+5
-0
lines changed
  • src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests

1 file changed

+5
-0
lines changed

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3363,6 +3363,7 @@ public void foo()
33633363

33643364
//See: https://developer.android.com/about/versions/marshmallow/android-6.0-changes#behavior-apache-http-client
33653365
[Test]
3366+
[Retry (5)]
33663367
public void MissingOrgApacheHttpClient ([Values ("dx", "d8")] string dexTool)
33673368
{
33683369
AssertDexToolSupported (dexTool);
@@ -3372,8 +3373,12 @@ public void MissingOrgApacheHttpClient ([Values ("dx", "d8")] string dexTool)
33723373
proj.AndroidManifest = proj.AndroidManifest.Replace ("</application>",
33733374
"<uses-library android:name=\"org.apache.http.legacy\" android:required=\"false\" /></application>");
33743375
proj.SetProperty ("AndroidEnableMultiDex", "True");
3376+
33753377
proj.PackageReferences.Add (KnownPackages.Xamarin_GooglePlayServices_Maps);
33763378
using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
3379+
string downloaddir = Path.Combine (Root, b.ProjectDirectory, "Downloads");
3380+
Directory.CreateDirectory (downloaddir);
3381+
proj.SetProperty ("XamarinBuildDownloadDir", downloaddir);
33773382
Assert.IsTrue (b.Build (proj), "Build should have succeeded");
33783383
}
33793384
}

0 commit comments

Comments
 (0)