[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
'*': 5128cce2dc/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.
This commit is contained in:
Rolf Bjarne Kvinge 2018-04-11 15:35:22 +02:00 коммит произвёл Marek Safar
Родитель 13aa6b7199
Коммит 99a992605f
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -1461,7 +1461,7 @@ namespace MonoTests.System.Net.Http
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);