Skip to content

Fix dashboard console logs page flaky test#13768

Merged
JamesNK merged 2 commits intomainfrom
jamesnk/consolepage-flakytest
Jan 6, 2026
Merged

Fix dashboard console logs page flaky test#13768
JamesNK merged 2 commits intomainfrom
jamesnk/consolepage-flakytest

Conversation

@JamesNK
Copy link
Copy Markdown
Member

@JamesNK JamesNK commented Jan 6, 2026

Fixes #12740

Copilot AI review requested due to automatic review settings January 6, 2026 05:03
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 6, 2026

🚀 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 -- 13768

Or

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

Copy link
Copy Markdown
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 fixes a flaky test by addressing a race condition in the console logs error handling logic. The test ReadingLogs_ErrorDuringRead_SetStatusAndLog was quarantined due to intermittent failures where the error status would be overwritten by the "finished watching logs" status in the finally block.

Key Changes:

  • Introduces a hasError flag to track whether an error occurred during log reading
  • Prevents the finally block from overwriting the error status with "finished watching logs" status
  • Unquarantines the previously flaky test

Reviewed changes

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

File Description
tests/Aspire.Dashboard.Components.Tests/Pages/ConsoleLogsTests.cs Removes quarantine attribute from the test and removes unused import
src/Aspire.Dashboard/Components/Pages/ConsoleLogs.razor.cs Adds hasError flag to prevent overwriting error status in the finally block

The implementation looks correct. The fix properly addresses the race condition by:

  1. Tracking when an error occurs via the hasError flag (line 811)
  2. Using this flag to prevent the finally block from overwriting the error status with the "finished" status (line 830)

This ensures that when an error occurs during log reading, the error status set at line 817 is preserved and not overwritten by the finally block at line 832.

@JamesNK JamesNK merged commit 4577489 into main Jan 6, 2026
286 checks passed
@JamesNK JamesNK deleted the jamesnk/consolepage-flakytest branch January 6, 2026 06:19
@dotnet-policy-service dotnet-policy-service bot added this to the 13.2 milestone Jan 6, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2026
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.

Failing test: Aspire.Dashboard.Components.Tests.Pages.ConsoleLogsTests.ReadingLogs_ErrorDuringRead_SetStatusAndLog

3 participants