From 99a992605f00313ca0ae82124075016e8ea58b0f Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 11 Apr 2018 15:35:22 +0200 Subject: [PATCH] [System.Net.Http] Use '*' as the host instead of '+' in the tests. Fixes 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 https://github.com/xamarin/maccore/issues/673. --- .../System.Net.Http/Test/System.Net.Http/HttpClientTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs index a7567cebc02..62e260b37e9 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs @@ -1461,7 +1461,7 @@ namespace MonoTests.System.Net.Http HttpListener CreateListener (Action 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);