Skip to content

[tests] Improve new BasicAuthWorksWhenBearerIsAdvertisedFirst test.#25503

Open
rolfbjarne wants to merge 4 commits into
mainfrom
dev/rolf/test-improvement
Open

[tests] Improve new BasicAuthWorksWhenBearerIsAdvertisedFirst test.#25503
rolfbjarne wants to merge 4 commits into
mainfrom
dev/rolf/test-improvement

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

  • Remove unused 'using System.Net.Http.Headers' directive.

  • Track request counts server-side and assert that at least one
    unauthenticated request was received before the authenticated retry,
    ensuring the test validates the actual challenge/fallback flow.

- Remove unused 'using System.Net.Http.Headers' directive.

- Track request counts server-side and assert that at least one
  unauthenticated request was received before the authenticated retry,
  ensuring the test validates the actual challenge/fallback flow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 refines the NSUrlSessionHandler authentication regression test to better validate the Basic-auth fallback behavior when the server advertises Bearer before Basic, and removes an unused import.

Changes:

  • Removed an unused using System.Net.Http.Headers; directive.
  • Added server-side request counters and assertions intended to verify that the client performs an unauthenticated request before retrying with Basic authentication.

Comment thread tests/monotouch-test/System.Net.Http/NSUrlSessionHandlerTest.cs Outdated
@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

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

rolfbjarne and others added 2 commits May 25, 2026 09:43
Instead of just counting unauthenticated and authenticated requests,
track the index of each to assert that the unauthenticated (401) request
arrived before the authenticated retry, proving the correct ordering.

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

This comment has been minimized.

@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 May 25, 2026 16:33
@rolfbjarne rolfbjarne enabled auto-merge (squash) May 25, 2026 16:33
@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

This comment has been minimized.

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

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

Pipeline on Agent
Hash: f16a2fb04d2b6647fffb829336986b4d07e50a17 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

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

✅ [PR Build #f16a2fb] Build passed (Build packages) ✅

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

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

✅ [PR Build #f16a2fb] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: f16a2fb04d2b6647fffb829336986b4d07e50a17 [PR build]

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

🔥 [CI Build #f16a2fb] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

0 tests crashed, 1 tests failed, 182 tests passed.

Failures

❌ monotouch tests (MacCatalyst)

1 tests failed, 19 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Release (trimmable static registrar, NativeAOT, ARM64): Failed (Test run crashed (exit code: 137).
    Test run crashed)

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 (iOS): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): 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: f16a2fb04d2b6647fffb829336986b4d07e50a17 [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.

4 participants