Skip to content

System.Net.Tests.HttpListenerPrefixCollectionTests.Add_InvalidPrefixNotStarted_ThrowsHttpListenerExceptionOnStart(uriPrefix: \"http://a08196d3572648a99e9d3669ecdda58c/\") fails in CI on mac OSX #21615

Description

@hughbe

As discussed in dotnet/corefx#19579

public static IEnumerable<object[]> InvalidPrefix_TestData()
{
    // [ActiveIssue()]
    if (!PlatfomDetection.IsOSX)
    {
        yield return new object[] { $"http://{Guid.NewGuid().ToString("N")}/" };
    }
}

[Theory]
[MemberData(nameof(InvalidPrefix_TestData))]
public void Add_InvalidPrefixNotStarted_ThrowsHttpListenerExceptionOnStart(string uriPrefix)
{
    var listener = new HttpListener();
    listener.Prefixes.Add(uriPrefix);

    Assert.Equal(1, listener.Prefixes.Count);
    Assert.True(listener.Prefixes.Contains(uriPrefix));
    Assert.Throws<HttpListenerException>(() => listener.Start());
}

This test fails with mac OSX:

MESSAGE:
Assert.Throws() Failure\nExpected: typeof(System.Net.HttpListenerException)\nActual: (No exception was thrown)
+++++++++++++++++++
STACK TRACE:
at System.Net.Tests.HttpListenerPrefixCollectionTests.Add_InvalidPrefixNotStarted_ThrowsHttpListenerExceptionOnStart(String uriPrefix) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug_prtest/src/System.Net.HttpListener/tests/HttpListenerPrefixCollectionTests.cs:line 264

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions