Repository navigation
[tests] Improve new BasicAuthWorksWhenBearerIsAdvertisedFirst test. - #25503
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 |
This comment has been minimized.
This comment has been minimized.
π [CI Build #f16a2fb] Test results πTest resultsβ All tests passed on VSTS: test results. π All 183 tests passed π Tests countsβ
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.