Skip to content

Commit

Permalink
Work around DNS problem on the build hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldeicaza committed Feb 21, 2014
1 parent ed2d8f0 commit c86473c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mcs/class/System/Test/System.Net/HttpListener2Test.cs
Expand Up @@ -744,7 +744,15 @@ public void ClosePort ()
[Test]
public void BindToSingleInterface ()
{
var machineAddress = Dns.GetHostAddresses (Dns.GetHostName ());
IPAddress [] machineAddress = null;

try {
machineAddress = Dns.GetHostAddresses (Dns.GetHostName ());
} catch (SocketException){
// The build hosts sometimes can not resolve the hostname
return;
}

int port = 61234;
var h = new HttpListener ();
h.Prefixes.Add ("http://" + machineAddress [0] + ":" + port + "/");
Expand Down

3 comments on commit c86473c

@knocte
Copy link
Contributor

@knocte knocte commented on c86473c Feb 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be an Assert.Ignore() call (or Inconclusive) instead of just return?

@akoeplinger
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. I've seen a few spots in the test code base where a return is used when Assert.Ignore() would be better. Inconclusive isn't available in the NUnit version Mono uses AFAIK.

@akoeplinger
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there were quite a lot of tests that did this, I corrected them so test results aren't skewed: #910

Please sign in to comment.