[tests] Improve new BasicAuthWorksWhenBearerIsAdvertisedFirst test.#25503
[tests] Improve new BasicAuthWorksWhenBearerIsAdvertisedFirst test.#25503rolfbjarne wants to merge 4 commits into
Conversation
- 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>
There was a problem hiding this comment.
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.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #f16a2fb] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #f16a2fb] Build passed (Build packages) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [PR Build #f16a2fb] Build passed (Build macOS tests) ✅Pipeline on Agent |
🔥 [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
Html Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
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.