Skip to content

[tests] Diagnose NSUrlSession redirect stalls - #26234

Merged
rolfbjarne merged 4 commits into
mainfrom
dev/rolf/dev-rolf-issue-26221-ci-ios-27-monotouch
Aug 3, 2026
Merged

[tests] Diagnose NSUrlSession redirect stalls#26234
rolfbjarne merged 4 commits into
mainfrom
dev/rolf/dev-rolf-issue-26221-ci-ios-27-monotouch

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Refactor the redirect credential tests through a shared timeout helper while retaining TestRuntime.TryRunAsync.

Improve the local HTTP server lifecycle by:

  • explicitly framing empty responses and disabling keep-alive
  • selecting listener ports randomly with bounded retries
  • logging listener startup and shutdown
  • logging progress around TestRuntime.TryRunAsync and HttpClient.GetAsync

This should make the next occurrence show whether progress stopped in the HTTP request, run-loop helper, listener setup, or listener disposal.

Related to #26221.

🤖 Pull request created by Copilot

Refactor the redirect credential tests through a shared timeout helper, improve the local HTTP server lifecycle, and add timing diagnostics around listener setup, requests, and shutdown.

Contributes towards #26221.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4c0289c1-b692-4cfd-8b01-09ad548d4628
@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.

Avoid local name collisions in the shared credential storage test and import System.Diagnostics so Stopwatch resolves outside the MonoTests.System namespace.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4c0289c1-b692-4cfd-8b01-09ad548d4628
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne
rolfbjarne marked this pull request as ready for review July 27, 2026 18:11
Copilot AI review requested due to automatic review settings July 27, 2026 18:11

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 monotouch-test’s System.Net.Http redirect/credential tests to better diagnose intermittent NSUrlSession redirect stalls by centralizing timeout handling and improving local HttpListener behavior and logging.

Changes:

  • Refactored redirect credential tests to use a shared GetResponseWithTimeout helper around TestRuntime.TryRunAsync.
  • Improved local HttpListener responses by explicitly framing empty responses (ContentLength64 = 0) and disabling keep-alive.
  • Updated listener startup/disposal with bounded retries and added detailed progress logging around listener lifecycle and HTTP requests.

Comment thread tests/monotouch-test/System.Net.Http/MessageHandlers.cs
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

rolfbjarne and others added 2 commits July 28, 2026 18:46
…HttpListener

Pick a random start port and then probe sequentially (with wraparound) so
each attempt tries a distinct port, avoiding the flakiness of repeatedly
hitting the same random busy ports while keeping the bounded retry behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@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: 41c53ff080fc8730ed4adfb7a51683162769df5f [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

🚀 [CI Build #41c53ff] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 203 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ 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 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 19 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 19 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (tvOS): All 19 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: 41c53ff080fc8730ed4adfb7a51683162769df5f [PR build]

@rolfbjarne
rolfbjarne enabled auto-merge (squash) August 3, 2026 10:58
@rolfbjarne rolfbjarne added the ready-to-review This PR is ready to review/merge. label Aug 3, 2026
@rolfbjarne
rolfbjarne merged commit dddf5e0 into main Aug 3, 2026
56 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/dev-rolf-issue-26221-ci-ios-27-monotouch branch August 3, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot ready-to-review This PR is ready to review/merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants