Skip to content

Commit

Permalink
harden tests for Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
antonfirsov committed Jan 31, 2025
1 parent 3f70a35 commit 10c469f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public Task MultiConnect_KeepAliveOptionsPreserved(bool dnsConnect) => MultiConn
int keepAliveInterval = (int)c.GetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveInterval)!;
int keepAliveRetryCount = (int)c.GetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveRetryCount)!;

Assert.Equal(1, keepAlive);
Assert.True(keepAlive is not 0);
Assert.Equal(5, keepAliveTime);
Assert.Equal(4, keepAliveInterval);
Assert.Equal(3, keepAliveRetryCount);
Expand Down Expand Up @@ -341,7 +341,8 @@ public async Task MultiConnect_ExposeHandle_TerminatesAtFirstFailure(bool dnsCon

SocketException ex = await Assert.ThrowsAsync<SocketException>(
async() => await (dnsConnect ? ConnectAsync(c, new DnsEndPoint("localhost", port)) : MultiConnectAsync(c, addresses, port)));
Assert.Equal(SocketError.ConnectionRefused, ex.SocketErrorCode);
Assert.True(ex.SocketErrorCode is SocketError.ConnectionRefused
or SocketError.TimedOut); // Some Mac OS 12 machines produce SocketError.TimedOut here.
}

[PlatformSpecific(TestPlatforms.AnyUnix)]
Expand Down

0 comments on commit 10c469f

Please sign in to comment.