Skip to content

Conversation

@JamesNK
Copy link
Member

@JamesNK JamesNK commented Oct 31, 2025

Description

I think some dashboard tests have been flaky because the next random port logic doesn't provide a min random number. A random increase of 0 could be used which would generate unexpected test results.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12534

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12534"

Copy link
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 enhances the LogOutput_LocalhostAddress_LocalhostInLogOutput test to improve reliability and add MCP endpoint logging verification. The test previously had issues with port allocation retries due to shared state between test sink instances.

  • Modified test to reuse a single TestSink instance across retries instead of recreating it, preventing log pollution from previous failed attempts
  • Added MCP endpoint configuration and verification to the test
  • Improved port collision detection in ServerRetryHelper with better random spacing and duplicate detection

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/Aspire.Dashboard.Tests/Integration/StartupTests.cs Enhanced test to verify MCP endpoint logging, fixed TestSink reuse issue, and added OTLP HTTP port configuration
tests/Aspire.Dashboard.Tests/Integration/ServerRetryHelper.cs Added duplicate port detection and improved random port spacing
src/Aspire.Dashboard/DashboardWebApplication.cs Added MCP endpoint logging to startup output

@JamesNK JamesNK force-pushed the jamesnk/fix-flaky-dashboard-test branch from c746109 to 7375feb Compare October 31, 2025 03:03
@JamesNK JamesNK enabled auto-merge (squash) October 31, 2025 03:33
@JamesNK JamesNK merged commit 64459de into main Oct 31, 2025
296 checks passed
@JamesNK JamesNK deleted the jamesnk/fix-flaky-dashboard-test branch October 31, 2025 03:34
@dotnet-policy-service dotnet-policy-service bot added this to the 13.0 milestone Oct 31, 2025
@JamesNK
Copy link
Member Author

JamesNK commented Oct 31, 2025

/backport to release/13.0

@github-actions
Copy link
Contributor

Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/18962795178

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants