Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests] Add backup ssl sites in case of 429 response. #7909

Merged
merged 2 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/Mono.Android-Tests/System.Net/ProxyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class ProxyTest {
[Test]
public void QuoteInvalidQuoteUrlsShouldWork ()
{
string url = "http://example.com/?query&foo|bar";
string url = "https://bing.com/?query&foo|bar";
var request = (HttpWebRequest) WebRequest.Create (url);
request.Method = "GET";
var response = (HttpWebResponse) request.GetResponse ();
Expand Down
21 changes: 17 additions & 4 deletions tests/Mono.Android-Tests/System.Net/SslTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,24 @@ public void HttpsShouldWork ()
void DoHttpsShouldWork ()
{
// string url = "https://bugzilla.novell.com/show_bug.cgi?id=634817";
string url = "https://encrypted.google.com/";
string[] urls = new string[] {
"https://dotnet.microsoft.com/",
"https://www.bing.com/",
"https://httpbin.org/get",
};
// string url = "http://slashdot.org";
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);
request.Method = "GET";
var response = (HttpWebResponse) request.GetResponse ();
HttpWebResponse response = null;
foreach (var url in urls) {
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);
request.Method = "GET";
response = (HttpWebResponse) request.GetResponse ();
if (response.StatusCode == HttpStatusCode.TooManyRequests) {
// try the next url.
continue;
}
break;
}
Assert.IsNotNull (response);
int len = 0;
using (var _r = new StreamReader (response.GetResponseStream ())) {
char[] buf = new char [4096];
Expand Down