Skip to content

[tests] Fix transient TLS/network failures in MessageHandlerTest tests - #25452

Merged
rolfbjarne merged 2 commits into
mainfrom
dev/rolf/issue-25444-transient-tls-issue
May 19, 2026
Merged

rolfbjarne merged 2 commits into
mainfrom
dev/rolf/issue-25444-transient-tls-issue

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Expand IgnoreInCIIfSshConnectionError to also detect 'A TLS error
caused the secure connection to fail' messages and
CFNetworkErrors.SecureConnectionFailed NSError codes by walking the
entire exception chain.

Add IgnoreInCIIfBadNetwork(ex) calls to tests that were only checking
HTTP status codes but not exceptions:

  • GHIssue8342
  • SupportsDigestAuthentication
  • GHIssue16339
  • AcceptSslCertificatesServicePointManager

Fixes #25444

Expand IgnoreInCIIfSshConnectionError to also detect 'A TLS error
caused the secure connection to fail' messages and
CFNetworkErrors.SecureConnectionFailed NSError codes by walking the
entire exception chain.

Add IgnoreInCIIfBadNetwork(ex) calls to tests that were only checking
HTTP status codes but not exceptions:
- GHIssue8342
- SupportsDigestAuthentication
- GHIssue16339
- AcceptSslCertificatesServicePointManager

Fixes #25444

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 18, 2026 12:49

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.

Pull request overview

This PR improves the resilience of network-dependent test runs in CI by broadening transient TLS/network error detection and ensuring key MessageHandler tests ignore known flaky CI-only failures (instead of failing due to thrown exceptions).

Changes:

  • Enhanced TestRuntime.IgnoreInCIIfSshConnectionError to scan the full exception chain for common TLS failure messages and to ignore CFNetworkErrors.SecureConnectionFailed (-1200) when running in CI.
  • Updated several MessageHandlerTest cases to call TestRuntime.IgnoreInCIIfBadNetwork (ex) in addition to existing HTTP status-based ignores.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/monotouch-test/System.Net.Http/MessageHandlers.cs Adds CI-ignore handling for transient network/TLS exceptions in several network-dependent tests.
tests/common/TestRuntime.cs Expands CI transient-network detection to include TLS failure messages and SecureConnectionFailed NSError codes across exception chains.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #213e64b] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 213e64b0eeaaba567eaa0fc7c58b375f57b20924 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #213e64b] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 213e64b0eeaaba567eaa0fc7c58b375f57b20924 [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: 213e64b0eeaaba567eaa0fc7c58b375f57b20924 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #213e64b] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 213e64b0eeaaba567eaa0fc7c58b375f57b20924 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne
rolfbjarne enabled auto-merge (squash) May 19, 2026 12:11
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #213e64b] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 175 tests passed 🎉

Tests counts

✅ 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 Publish failed ⚠️) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. (⚠️ Html Report Publish failed ⚠️) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. (⚠️ Html Report Publish failed ⚠️) Download
✅ fsharp: All 4 tests passed. [attempt 2] 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. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (iOS): All 16 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. (⚠️ Html Report Publish failed ⚠️) Download
✅ monotouch (macOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 16 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 Publish failed ⚠️) 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: 213e64b0eeaaba567eaa0fc7c58b375f57b20924 [PR build]

@rolfbjarne
rolfbjarne merged commit ca36f53 into main May 19, 2026
49 checks passed
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] Transient TLS/network failures affecting multiple tests (May 15)

4 participants