Skip to content

[tests] Remove obsolete Ping regression test - #13702

Merged
simonrozsival merged 3 commits into
mainfrom
simonrozsival-fix-flaky-pinglocalhost-test
Nov 23, 2026
Merged

simonrozsival merged 3 commits into
mainfrom
simonrozsival-fix-flaky-pinglocalhost-test

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Fixes: #13642
Context: #11530

PingTest.PingLocalhost was added in #11531 after Ping.Send() crashed while starting a process because the hand-maintained CoreCLR BCL P/Invoke table lacked SystemNative_IsAtomicNonInheritablePipeCreationSupported (#11530).

#11537 stopped serving BCL P/Invokes from that table, #12010 removed CoreCLR's table and generator, and #13116 later simplified the resolver to use dynamic symbol lookup. The test no longer guards against the original table-drift failure.

The test intermittently returned TimedOut in NativeAOT device CI: 1682607, 1681205, and 1672500. Two passed on retry of the same commit; the cause remains unproven. Remove the test and its project entry instead of relying on the flaky loopback-ICMP assertion. This intentionally removes end-to-end Ping.Send() coverage; it does not establish why ping timed out.

Validation

  • git diff origin/main...HEAD --check — passed.
  • xmllint --noout tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj — passed.
  • ./dotnet-local.sh msbuild tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj -getItem:Compile -nologo -p:Configuration=Release -p:TargetFramework=net12.0-android — passed; the evaluated Compile items do not include PingTest.cs.
  • make leeroy CONFIGURATION=Release — passed.
  • ./dotnet-local.sh build tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj -c Release -v:minimal — passed with 78 warnings and no errors.
  • On-device tests were not run: this deletes a test and does not change runtime code.

simonrozsival and others added 3 commits November 21, 2026 00:15
Context: #13642

Android apps cannot open raw ICMP sockets, so Ping.Send() runs
/system/bin/ping and waits only `timeout` for the process to start,
ping, and exit. With a 1000ms timeout, slow process launch on an
overloaded emulator returns IPStatus.TimedOut without any ICMP loss.

Use a 30s timeout: loopback replies immediately, so it only bounds the
failure path. Keep asserting IPStatus.Success so the end-to-end
Process.Start()/SystemNative coverage from #11530 is preserved, and
report elapsed time on failure.

Co-authored-by: Copilot App <[email protected]>
Context: #13642

The previous commit's comment overstated the cause. In the pinned
runtime, Ping.SendWithPingUtility() calls Process.Start() before
WaitForExit(timeout), so fork/exec is outside the wait; child startup,
the ICMP round trip, exit, and SIGCHLD-driven reaping are inside it.
Ping also reports TimedOut when ping exits 1 or 2 after
`-W ceil(timeout/1s)`. All three CI failures were in the NativeAOT run;
the cause remains unproven.

Keep the end-to-end IPStatus.Success assertion with a 30s budget that
only bounds the failure path, and add ProcessStartAndWaitForExit, which
exercises the same Process.Start()/WaitForExit() path without ICMP so a
future failure can be attributed to process handling or to ping.

Co-authored-by: Copilot App <[email protected]>
Context: #13642
Context: #11531
Context: #11537
Context: #12010

PingLocalhost was added to catch a missing SystemNative entry in the CoreCLR precompiled P/Invoke table. BCL P/Invokes no longer use that table, and the table generator was subsequently removed, so the flaky ICMP-dependent test no longer guards that failure mode. Remove it and its explicit project inclusion; this also removes end-to-end Ping coverage from this suite.

Validation: git diff --check and xmllint --noout on the test project passed. The Release SDK build was stopped when this became a test-only deletion; no device run was performed.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 21, 2026 00:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for removing the obsolete ping regression test and its compile entry.

No open issues 🎉

What changed in this PR

Removes the flaky PingLocalhost device test from the .NET for Android test suite now that CoreCLR no longer uses the hand-maintained native-symbol table behind the original regression.

Changes:

  • Deletes the loopback ping test and its explicit project compile entry.
  • Intentionally removes end-to-end Ping.Send() coverage without claiming to resolve the intermittent timeouts.
File Description
tests/​Mono.Android-Tests/​Mono.Android-Tests/​System.Net.NetworkInformation/​PingTest.cs Deletes the obsolete ping regression test.
tests/​Mono.Android-Tests/​Mono.Android-Tests/​Mono.Android.NET-Tests.csproj Removes the deleted test’s compile entry.

Review effort: Balanced

@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #13702

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code assessment: no findings — 0 errors, 0 warnings, 0 suggestions.

The deletion is internally consistent: PingTest.cs and its explicit Compile entry are both removed, default compile items are disabled, and no remaining C# or project references to the fixture were found under src/ or tests/. The current CoreCLR resolver uses dlsym, consistent with retiring coverage for the hand-maintained P/Invoke table. The description appropriately acknowledges that this removes end-to-end Ping.Send() coverage rather than proving or fixing the timeout's cause. No production runtime behavior is changed.

CI verification is incomplete. All 39 head-commit GitHub checks report success, including the aggregate dotnet-android check for build 1693173. Direct Azure build verification was blocked by the CLI's authentication requirement; the timeline query also failed during CLI initialization. I therefore cannot independently confirm the Azure build result or non-gating device-test outcomes. Linked issue details were not independently available through the exposed GitHub tools. No local build or device tests were run for this review.

No inline comments were queued: the diff consists entirely of deletions, so there are no added or modified lines eligible under the requested commenting constraints. No code changes are requested.

Generated by Android PR Reviewer for #13702 · copilot · gpt61 · 17 AIC · ⌖ 4.89 AIC · ⊞ 21K
Comment /review to run again

@simonrozsival
simonrozsival merged commit 2e7d343 into main Nov 23, 2026
39 checks passed
@simonrozsival
simonrozsival deleted the simonrozsival-fix-flaky-pinglocalhost-test branch November 23, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Flaky test] PingTest.PingLocalhost

3 participants