[tests] Fix flaky BasicAuthWorksWhenBearerIsAdvertisedFirst test. Fixes #25597#25604
Conversation
#25597 The test was getting HTTP 404 on a CI bot, but the local HttpListener server never returns 404. The likely cause is localhost resolving to ::1 (IPv6) on certain macOS bots while HttpListener with http://*:port/ only binds to IPv4. The request reaches something else and gets 404. Fix: - Use 127.0.0.1 explicitly in both the HttpListener prefix and the request URL to avoid IPv6/hostname resolution mismatches. - Add CI tolerance: if the server received zero requests and the status is 404, mark the test as inconclusive (infrastructure issue, not a code bug). - Add IgnoreInCIIfBadNetwork and timeout handling consistent with other tests in this file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR addresses CI flakiness in BasicAuthWorksWhenBearerIsAdvertisedFirst by making the loopback HTTP test server binding deterministic and adding CI-oriented tolerance for infrastructure/network failures, so the test better reflects product correctness instead of environment variance.
Changes:
- Bind the
HttpListenerexplicitly to127.0.0.1and send requests to127.0.0.1(avoids IPv6::1vs IPv4 binding mismatches). - Add timeout handling consistent with other tests in the file, including
TestRuntime.IgnoreInCIIfBadNetwork. - Treat “404 + server received zero requests” as an infrastructure failure in CI (ignore/inconclusive) instead of a product regression.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🔥 [CI Build #3b0fc29] Test results 🔥Test results❌ Tests failed on VSTS: test results 20 tests crashed, 24 tests failed, 57 tests passed. Failures❌ cecil tests🔥 Failed catastrophically on VSTS: test results - cecil (no summary found). Html Report (VSDrops) Download ❌ dotnettests tests (iOS)🔥 Failed catastrophically on VSTS: test results - dotnettests_ios (no summary found). Html Report (VSDrops) Download ❌ dotnettests tests (MacCatalyst)🔥 Failed catastrophically on VSTS: test results - dotnettests_maccatalyst (no summary found). Html Report (VSDrops) Download ❌ dotnettests tests (macOS)🔥 Failed catastrophically on VSTS: test results - dotnettests_macos (no summary found). Html Report (VSDrops) Download ❌ dotnettests tests (Multiple platforms)🔥 Failed catastrophically on VSTS: test results - dotnettests_multiple (no summary found). Html Report (VSDrops) Download ❌ framework tests🔥 Failed catastrophically on VSTS: test results - framework (no summary found). Html Report (VSDrops) Download ❌ fsharp tests2 tests failed, 2 tests passed.Failed tests
Html Report (VSDrops) Download ❌ generator tests🔥 Failed catastrophically on VSTS: test results - generator (no summary found). Html Report (VSDrops) Download ❌ interdependent-binding-projects tests🔥 Failed catastrophically on VSTS: test results - interdependent-binding-projects (no summary found). Html Report (VSDrops) Download ❌ linker tests (macOS)🔥 Failed catastrophically on VSTS: test results - linker_macos (no summary found). Html Report (VSDrops) Download ❌ linker tests (tvOS)🔥 Failed catastrophically on VSTS: test results - linker_tvos (no summary found). Html Report (VSDrops) Download ❌ monotouch tests (iOS)🔥 Failed catastrophically on VSTS: test results - monotouch_ios (no summary found). Html Report (VSDrops) Download ❌ monotouch tests (MacCatalyst)2 tests failed, 21 tests passed.Failed tests
Html Report (VSDrops) Download ❌ monotouch tests (macOS)🔥 Failed catastrophically on VSTS: test results - monotouch_macos (no summary found). Html Report (VSDrops) Download ❌ monotouch tests (tvOS)20 tests failed, 0 tests passed.Failed tests
|
✅ [PR Build #3b0fc29] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #3b0fc29] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #3b0fc29] Build passed (Detect API changes) ✅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 |
🚀 [CI Build #3b0fc29] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 193 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. [attempt 2] Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
The test was getting HTTP 404 on a CI bot, but the local HttpListener
server never returns 404. The likely cause is localhost resolving to
::1 (IPv6) on certain macOS bots while HttpListener with http://*:port/
only binds to IPv4. The request reaches something else and gets 404.
Fix:
request URL to avoid IPv6/hostname resolution mismatches.
is 404, mark the test as inconclusive (infrastructure issue, not a
code bug).
tests in this file.