Skip to content

Commit

Permalink
Workaround for dotnet#47714
Browse files Browse the repository at this point in the history
  • Loading branch information
antonfirsov committed Feb 2, 2021
1 parent 02ef191 commit 91d4b1a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,18 @@ public async Task AddressFamilyDoesNotMatch_Throws_ArgumentException()
public async Task NotBound_Throws_InvalidOperationException()
{
using Socket socket = CreateSocket();
await Assert.ThrowsAsync<InvalidOperationException>(() => ReceiveFromAsync(socket, new byte[1], GetGetDummyTestEndpoint()));

// ReceiveFromAsync(saea) throws SocketException:
// [ActiveIssue("https://github.com/dotnet/runtime/issues/47714")]
if (UsesEap)
{
await Assert.ThrowsAsync<SocketException>(() => ReceiveFromAsync(socket, new byte[1], GetGetDummyTestEndpoint()));
}
else
{
await Assert.ThrowsAsync<InvalidOperationException>(() => ReceiveFromAsync(socket, new byte[1], GetGetDummyTestEndpoint()));
}

}

[Theory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public async Task AddressFamilyDoesNotMatch_Throws_ArgumentException()
[Fact]
public async Task NotBound_Throws_InvalidOperationException()
{
// ReceiveFromAsync(saea) throws SocketException / fails with Debug.Assert():
// [ActiveIssue("https://github.com/dotnet/runtime/issues/47714")]
if (UsesEap) return;

using Socket socket = CreateSocket();
await Assert.ThrowsAsync<InvalidOperationException>(() => ReceiveMessageFromAsync(socket, new byte[1], GetGetDummyTestEndpoint()));
}
Expand Down

0 comments on commit 91d4b1a

Please sign in to comment.