diff --git a/tests/monotouch-test/Foundation/NSDataTest.cs b/tests/monotouch-test/Foundation/NSDataTest.cs index ef1b51873a77..43219fc3a1ae 100644 --- a/tests/monotouch-test/Foundation/NSDataTest.cs +++ b/tests/monotouch-test/Foundation/NSDataTest.cs @@ -155,10 +155,27 @@ public void Https () Assert.Ignore ("NSData.FromUrl doesn't seem to work in watchOS"); } #endif - using (var url = new NSUrl ("https://www.microsoft.com/robots.txt")) - using (var x = NSData.FromUrl (url)) { - Assert.That ((x != null) && (x.Length > 0)); + // we have network issues, try several urls, if one works, be happy, else fail + var urls = new string [] { + "https://www.microsoft.com/robots.txt", + "https://www.xamarin.com/robots.txt", + "http://www.bing.com/robots.txt", + "https://www.xbox.com/robots.txt", + "https://www.msn.com/robots.txt", + "https://visualstudio.microsoft.com/robots.txt", + }; + for (var i = 0; i < urls.Length; i++) { + NSError error; + using (var nsUrl = new NSUrl (urls [i])) + using (var x = NSData.FromUrl (nsUrl, NSDataReadingOptions.Uncached, out error)) { + if (error != null) + continue; + Assert.That (x != null); + Assert.That (x.Length > 0); + return; + } } + Assert.Fail ("None of the urls could be fetch."); } [Test]