Skip to content

Commit

Permalink
[System.Net.Http] Use '*' as the host instead of '+' in the tests. Fixes
Browse files Browse the repository at this point in the history
 xamarin/maccore#673.

Use '*' as the host instead of '+' in the tests.

The behavior should be the same, just faster, because '+' will fail to resolve
("Could not resolve host '+'"), and we'll fall back to the same behavior as
'*': https://github.com/mono/mono/blob/5128cce2dcd097aa4e7b86dd3b56e833c15a9ff0/mcs/class/System/System.Net/EndPointManager.cs#L83-L96

The problem arises when failing to resolve '+' takes a long time: on some of
our bots it takes 5-10 seconds. This adds up quickly since the tests try many
times, effectively increasing a test run from 1-2 seconds to 30+ minutes.

Fixes xamarin/maccore#673.
  • Loading branch information
rolfbjarne authored and marek-safar committed Apr 12, 2018
1 parent 13aa6b7 commit 99a9926
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ public void WildcardConnect ()
HttpListener CreateListener (Action<HttpListenerContext> contextAssert, int port)
{
var l = new HttpListener ();
l.Prefixes.Add (string.Format ("http://+:{0}/", port));
l.Prefixes.Add (string.Format ("http://*:{0}/", port));
l.Start ();
AddListenerContext(l, contextAssert);

Expand Down

0 comments on commit 99a9926

Please sign in to comment.