Repository navigation
Test failure: PingTest.SendPingWithLowTtl_RoundtripTimeIsNonZero flaky on macOS 26 ARM64 (sub-ms RTT truncated to 0) #132123
Description
Test failure
System.Net.NetworkInformation.Tests.PingTest.SendPingWithLowTtl_RoundtripTimeIsNonZero is failing in outerloop on macOS 26 ARM64 (OSX.26.Arm64.Open), starting 2026-08-09.
Error message
Expected at least one TtlExpired reply with non-zero RoundtripTime across 3 attempts
Frequency
2 builds on main over the past 7 days, exclusively on the osx.26.arm64.open queue (runtime-libraries-coreclr outerloop-osx). Not seen on any other platform.
Root cause
Environment/platform-specific test fragility, not a product bug.
The test (src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs) pings with Ttl = 5, expects a TtlExpired/TimeExceeded reply, and asserts at least one of 3 attempts reports a non-zero RoundtripTime:
// On macOS, the raw socket implementation truncates sub-millisecond RTT to 0,
// and the first-hop router often responds in <1ms.
options.Ttl = 5;
bool gotNonZeroRtt = false;
for (int attempt = 0; attempt < 3; attempt++)
{
PingReply pingReply = await ping.SendPingAsync(host, TestSettings.PingTimeout, payload, options);
Assert.True(pingReply.Status == IPStatus.TimeExceeded || pingReply.Status == IPStatus.TtlExpired, ...);
if (pingReply.RoundtripTime > 0) { gotNonZeroRtt = true; break; }
}
Assert.True(gotNonZeroRtt, "Expected at least one TtlExpired reply with non-zero RoundtripTime across 3 attempts");The test comment already acknowledges the failure mode: macOS raw sockets truncate sub-millisecond RTT to 0. On the fast Azure OSX.26.Arm64 CI runners the first-hop router consistently replies in under 1ms, so all 3 attempts measure RoundtripTime == 0 and the assertion fails. This is inherently timing/environment dependent and will flake on fast, low-latency network paths.
Suggested fix
Make the test robust to sub-millisecond RTT on macOS, e.g.:
- Skip the non-zero-RTT assertion on macOS (the RTT-truncation platform), or
- Increase the number of attempts and/or accept
RoundtripTime >= 0on platforms known to truncate sub-ms RTT, keeping the strict> 0assertion only where the raw-socket path preserves sub-ms timing.
Sample console log
Known issue error message
Fill the error message using known issues.
{
"ErrorMessage": "Expected at least one TtlExpired reply with non-zero RoundtripTime across 3 attempts",
"BuildRetry": false,
"ExcludeConsoleLog": false
}Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1546596
Error message validated: [Expected at least one TtlExpired reply with non-zero RoundtripTime across 3 attempts]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 8/11/2026 9:19:16 AM UTC
Report
| Build | Repository | Test | Pull Request |
|---|---|---|---|
| 1617677 | dotnet/runtime | System.Net.NetworkInformation.Tests.PingTest.SendPingWithLowTtl_RoundtripTimeIsNonZero | #134920 |
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 0 | 1 |
Activity
dotnet-policy-service commentedon Aug 11, 2026
Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.