Skip to content

[release/10.0.1xx] [tests] Treat missing expected cookie as transient network failure in TestNSurlSessionHandlerCookieContainerSetCookie#25627

Merged
rolfbjarne merged 2 commits into
release/10.0.1xxfrom
dev/rolf/backport-pr-25420-release/10.0.1xx-2026-06-03
Jun 3, 2026
Merged

[release/10.0.1xx] [tests] Treat missing expected cookie as transient network failure in TestNSurlSessionHandlerCookieContainerSetCookie#25627
rolfbjarne merged 2 commits into
release/10.0.1xxfrom
dev/rolf/backport-pr-25420-release/10.0.1xx-2026-06-03

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member
  • Fix TestNSurlSessionHandlerCookieContainerSetCookie to treat missing expected cookie as transient network failure (ignore in CI)
  • Address race condition: move CookieContainer inspection after !completed guard to avoid concurrent access
  • Address exception masking: separate !completed and !hasExpectedCookie CI-ignore guards so real exceptions still fail the test

Fixes #25385.


Co-authored-by: rolfbjarne 249268+rolfbjarne@users.noreply.github.com

Backport of #25420.

Copilot AI and others added 2 commits June 3, 2026 11:07
…stNSurlSessionHandlerCookieContainerSetCookie

Agent-Logs-Url: https://github.com/dotnet/macios/sessions/08f85733-39b4-40c6-bcf5-d46ae2c50f48

Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
…HandlerCookieContainerSetCookie

Agent-Logs-Url: https://github.com/dotnet/macios/sessions/269d09e0-2844-4dfa-9c95-470afec2eead

Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 3, 2026 09:08
@rolfbjarne

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

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 updates a flaky network-dependent cookie test to treat a missing expected cookie as a transient CI failure, reducing intermittent CI failures in the System.Net.Http test suite for Apple platforms.

Changes:

  • Adds a hasExpectedCookie boolean and treats the “cookie missing” case as ignorable in CI.
  • Keeps the assertion for local runs so the test still fails outside CI when the expected cookie is not observed.

Comment on lines +205 to +206
if (!hasExpectedCookie)
TestRuntime.IgnoreInCI ("Transient network failure - ignore in CI");
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #1869d5e] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 1869d5ebb9a7018b0853f49a574650fd4a888117 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #1869d5e] Build passed (Build packages) ✅

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

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #1869d5e] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 1869d5ebb9a7018b0853f49a574650fd4a888117 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #1869d5e] 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 (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. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (iOS): All 16 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. [attempt 2] 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 (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: 1869d5ebb9a7018b0853f49a574650fd4a888117 [PR build]

@rolfbjarne rolfbjarne merged commit 1fa7b29 into release/10.0.1xx Jun 3, 2026
49 checks passed
@rolfbjarne rolfbjarne deleted the dev/rolf/backport-pr-25420-release/10.0.1xx-2026-06-03 branch June 3, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants