Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -803,15 +803,20 @@ private async Task Ping_TimedOut_Core(Func<Ping, string, Task<PingReply>> sendPi
reply = await sendPing(sender, TestSettings.UnreachableAddress3);
}

if (reply.Status == IPStatus.DestinationNetworkUnreachable)
{
throw new SkipTestException("Unable to verify timeouts. Skipping test.");
}

Assert.Equal(IPStatus.TimedOut, reply.Status);
}

[Fact]
[ConditionalFact]
[OuterLoop]
public Task Ping_TimedOut_Sync_Success()
=> Ping_TimedOut_Core((sender, address) => Task.Run(() => sender.Send(address)));

[Fact]
[ConditionalFact]
[OuterLoop]
public Task Ping_TimedOut_EAP_Success()
=> Ping_TimedOut_Core(async (sender, address) =>
Expand Down Expand Up @@ -841,7 +846,7 @@ static void PingCompleted(object sender, PingCompletedEventArgs e)
return reply;
});

[Fact]
[ConditionalFact]
[OuterLoop]
public Task Ping_TimedOut_TAP_Success()
=> Ping_TimedOut_Core((sender, address) => sender.SendPingAsync(address));
Expand Down
Loading