Skip to content

Fix flaky CtorIPAddressPair test. Fixes #25242#25308

Draft
rolfbjarne wants to merge 2 commits intomainfrom
dev/rolf/isuse-25242-ci-postmortem-ctoripaaddresspair
Draft

Fix flaky CtorIPAddressPair test. Fixes #25242#25308
rolfbjarne wants to merge 2 commits intomainfrom
dev/rolf/isuse-25242-ci-postmortem-ctoripaaddresspair

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

Fix the flaky NetworkReachabilityTest.CtorIPAddressPair test (monotouch-test, macOS).

Two sources of flakiness addressed:

  1. DNS resolution failure: Dns.GetHostAddresses("apple.com") can throw when DNS is unavailable in CI. Wrapped in try-catch with TestRuntime.IgnoreInCIIfBadNetwork so transient DNS failures are only ignored on CI (locally the test still fails).

  2. Overly strict flags assertion: The remote-address flags check required exactly Reachable (after stripping TransientConnection). Different OS versions can report additional flags like ConnectionRequired. Added a CheckRemoteFlags helper that verifies Reachable is set and no unexpected flags appear — matching the existing CheckLoopbackFlags philosophy.

Other changes:

  • Added NetworkResources.AppleHost constant instead of hardcoding "apple.com" in the test.

Fixes #25242

🤖 Pull request created by Copilot

rolfbjarne and others added 2 commits May 4, 2026 12:03
Two sources of flakiness:

1. Dns.GetHostAddresses("apple.com") can throw if DNS resolution
   fails in CI. Wrap in try-catch and Assert.Ignore on failure.

2. The flags assertion for the remote address was too strict - it only
   allowed Reachable + TransientConnection. Different OS versions can
   report additional flags (e.g. ConnectionRequired). Use a new
   CheckRemoteFlags helper that verifies Reachable is set and no
   unexpected flags appear, matching the approach already used by
   CheckLoopbackFlags.

Fixes #25242

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add NetworkResources.AppleHost constant instead of hardcoding
  'apple.com' in the test.
- Use TestRuntime.IgnoreInCIIfBadNetwork to only ignore transient DNS
  failures on CI (locally the test will still fail if DNS is down).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #7e358c6] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 7e358c6eb5faffbf22556a34e8381872643d177a [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #7e358c6] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 7e358c6eb5faffbf22556a34e8381872643d177a [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 7e358c6eb5faffbf22556a34e8381872643d177a [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #7e358c6] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 7e358c6eb5faffbf22556a34e8381872643d177a [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🔥 [CI Build #7e358c6] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

0 tests crashed, 26 tests failed, 143 tests passed.

Failures

❌ monotouch tests (iOS)

13 tests failed, 0 tests passed.

Failed tests

  • monotouch-test/iOS - simulator/Debug: LaunchTimedOut
  • monotouch-test/iOS - simulator/Debug (LinkSdk): LaunchTimedOut
  • monotouch-test/iOS - simulator/Debug (static registrar): LaunchTimedOut
  • monotouch-test/iOS - simulator/Release (all optimizations): LaunchTimedOut
  • monotouch-test/iOS - simulator/Debug (ARM64): LaunchTimedOut
  • monotouch-test/iOS - simulator/Release (NativeAOT, ARM64): LaunchTimedOut
  • monotouch-test/iOS - simulator/Release (trimmable static registrar, NativeAOT, ARM64): LaunchTimedOut
  • monotouch-test/iOS - simulator/Debug (managed static registrar): LaunchTimedOut
  • monotouch-test/iOS - simulator/Release (managed static registrar, all optimizations): LaunchTimedOut
  • monotouch-test/iOS - simulator/Release (NativeAOT, x64): LaunchTimedOut
  • monotouch-test/iOS - simulator/Release (trimmable static registrar, NativeAOT, x64): LaunchTimedOut
  • monotouch-test/iOS - simulator/Debug (interpreter): LaunchTimedOut
  • monotouch-test/iOS - simulator/Release (interpreter): LaunchTimedOut

Html Report (VSDrops) Download

❌ monotouch tests (tvOS)

13 tests failed, 0 tests passed.

Failed tests

  • monotouch-test/tvOS - simulator/Debug: LaunchTimedOut
  • monotouch-test/tvOS - simulator/Debug (LinkSdk): LaunchTimedOut
  • monotouch-test/tvOS - simulator/Debug (static registrar): LaunchTimedOut
  • monotouch-test/tvOS - simulator/Release (all optimizations): LaunchTimedOut
  • monotouch-test/tvOS - simulator/Debug (ARM64): LaunchTimedOut
  • monotouch-test/tvOS - simulator/Release (NativeAOT, ARM64): LaunchTimedOut
  • monotouch-test/tvOS - simulator/Release (trimmable static registrar, NativeAOT, ARM64): LaunchTimedOut
  • monotouch-test/tvOS - simulator/Debug (managed static registrar): LaunchTimedOut
  • monotouch-test/tvOS - simulator/Release (managed static registrar, all optimizations): LaunchTimedOut
  • monotouch-test/tvOS - simulator/Release (NativeAOT, x64): LaunchTimedOut
  • monotouch-test/tvOS - simulator/Release (trimmable static registrar, NativeAOT, x64): LaunchTimedOut
  • monotouch-test/tvOS - simulator/Debug (interpreter): LaunchTimedOut
  • monotouch-test/tvOS - simulator/Release (interpreter): LaunchTimedOut

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 7e358c6eb5faffbf22556a34e8381872643d177a [PR build]

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.

[CI Postmortem] Flaky: MonoTouchFixtures.SystemConfiguration.NetworkReachabilityTest.CtorIPAddressPair

2 participants