Skip to content

[tests] Fix flaky SecureTransportTest.Tls12 by ignoring network timeouts in CI - #25302

Merged
rolfbjarne merged 2 commits into
mainfrom
dev/rolf/25241-fix-flaky-tls12-test
May 5, 2026
Merged

[tests] Fix flaky SecureTransportTest.Tls12 by ignoring network timeouts in CI#25302
rolfbjarne merged 2 commits into
mainfrom
dev/rolf/25241-fix-flaky-tls12-test

Conversation

@rolfbjarne

@rolfbjarne rolfbjarne commented May 4, 2026

Copy link
Copy Markdown
Member

Wrap the Tls12 test body in a try/catch that calls TestRuntime.IgnoreInCIIfBadNetwork to mark the test as ignored (rather than failed) when transient network issues occur in CI.

Also extend IgnoreInCIIfTimedOut to handle SocketException timeouts, not just WebException timeouts, so that the SocketException thrown by TcpClient is properly recognized.

Fixes #25241

…uts in CI

Wrap the Tls12 test body in a try/catch that calls
TestRuntime.IgnoreInCIIfBadNetwork to mark the test as ignored (rather
than failed) when transient network issues occur in CI.

Also extend IgnoreInCIIfTimedOut to handle SocketException timeouts, not
just WebException timeouts, so that the SocketException thrown by
TcpClient is properly recognized.

Fixes #25241

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

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 aims to reduce flakiness in the SecureTransport external-network test suite by treating transient CI network timeouts as ignorable test noise instead of hard failures. It updates the SecureTransport TLS 1.2 test and the shared test runtime helper that classifies transient network errors across the repository.

Changes:

  • Wrapped SecureTransportTest.Tls12 in a try/catch so CI can ignore recognized transient network failures instead of failing the test.
  • Extended TestRuntime.IgnoreInCIIfTimedOut (Exception ex) to recognize SocketException timeouts in addition to the existing WebException timeout handling.
  • Kept the existing TLS 1.2 handshake/request assertions intact while routing failures through the shared CI network-flake helper.

Reviewed changes

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

File Description
tests/monotouch-test/Security/SecureTransportTest.cs Adds CI-specific bad-network handling around the external TLS 1.2 test.
tests/common/TestRuntime.cs Extends shared timeout classification so socket connect timeouts can be ignored in CI.

Comment thread tests/monotouch-test/Security/SecureTransportTest.cs
Comment thread tests/monotouch-test/Security/SecureTransportTest.cs
Comment thread tests/monotouch-test/Security/SecureTransportTest.cs Outdated
- Add 30-second deadlines to both the handshake and read retry loops to
  prevent indefinite hangs in CI.
- Replace magic number -108 with the existing errSecAllocate constant.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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 #9a8e2ad] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 9a8e2ad48b8a8561c72a70dd01fefc8a9020ea54 [PR build]

@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 #9a8e2ad] Build passed (Build packages) ✅

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

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #9a8e2ad] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 9a8e2ad48b8a8561c72a70dd01fefc8a9020ea54 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne
rolfbjarne enabled auto-merge (squash) May 5, 2026 06:21
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #9a8e2ad] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 169 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 (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. [attempt 2] Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 13 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
✅ monotouch (tvOS): All 13 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: 9a8e2ad48b8a8561c72a70dd01fefc8a9020ea54 [PR build]

@rolfbjarne
rolfbjarne merged commit 90c27c8 into main May 5, 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] Flaky: MonoTouchFixtures.Security.SecureTransportTest.Tls12

4 participants