Fix Outerloop dashboard test: Kestrel rejects dynamic-port bind on "localhost" - #18246
Conversation
The BrowserTokenDashboardServerWithHttpAndHttpsFixture bound the dashboard
frontend to "https://localhost:0;http://localhost:0". Kestrel rejects
dynamic-port (":0") binding on the "localhost" hostname:
System.InvalidOperationException: Dynamic port binding is not supported
when binding to localhost. You must either bind to 127.0.0.1:0 or
[::1]:0, or both.
So the fixture threw in InitializeAsync and
BrowserToken_QueryStringToken_HttpsThenHttp_WebKit_Success failed every
scheduled Outerloop run. Bind to 127.0.0.1:0 instead, matching the base
DashboardServerFixture. The WebKit test navigates to the resolved address
with IgnoreHTTPSErrors, so the loopback IP is fine.
Broken since the fixture was introduced in microsoft#17368.
Refs microsoft#18223
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18246Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18246" |
There was a problem hiding this comment.
Pull request overview
This PR fixes a broken Outerloop dashboard Playwright test (BrowserToken_QueryStringToken_HttpsThenHttp_WebKit_Success) that has been failing on every scheduled run. The fixture was binding Kestrel to localhost:0, which Kestrel explicitly rejects for dynamic port allocation — the fix uses 127.0.0.1:0 instead, consistent with the base DashboardServerFixture.
Changes:
- Replace
https://localhost:0;http://localhost:0withhttps://127.0.0.1:0;http://127.0.0.1:0in the test fixture, and add a comment explaining the Kestrel constraint.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Consolidating the unapproved Outerloop test fixes into a single PR: #18250. Closing in favor of that one (same change, preserved authorship). |
BrowserToken_QueryStringToken_HttpsThenHttp_WebKit_Successfails every scheduled Outerloop run — its class fixture throws before any test body runs:Root cause. The fixture binds the dashboard frontend to
https://localhost:0;http://localhost:0. Kestrel doesn't support dynamic-port (:0) binding on thelocalhosthostname — the constraint is hostname-based, independent of scheme. The baseDashboardServerFixturealready binds127.0.0.1:0and works.Fix. Bind to
https://127.0.0.1:0;http://127.0.0.1:0. The WebKit test navigates to the endpoint's resolved address withIgnoreHTTPSErrors, so the loopback IP is fine.Verified locally: a minimal Kestrel app reproduces the exact exception on
localhost:0and binds successfully on127.0.0.1:0; the test project compiles. The Playwright test itself runs only in the browser-enabled Outerloop environment.Broken since the fixture was added in #17368. Surfaced by workflow-health report #18223.
Refs #18223