Repository navigation
Wait for exemplars dialog in metrics component test - #21394
James Newton-King (JamesNK) wants to merge 1 commit into
Conversation
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 -- 21394Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21394" |
Tests selector1 / 100 PR test projects · 0 PR jobs, from 1 changed file. Selected PR test projects (1 / 100)
Selected PR jobs (0)none How these were chosen — grouped by what changed🧪 Job reasonsnone Selection computed for commit |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the test-only change that waits for asynchronous exemplar dialog assertions.
No open issues 🎉
What changed in this PR
Addresses a timing race in the dashboard metrics component test by waiting for exemplar dialog assertions after the button click. This is a test-only change; dashboard behavior is unchanged.
Changes:
- Wraps dialog assertions in
cut.WaitForAssertion. - Preserves checks for a single dialog, instrument identity, exemplar values, and timestamps.
| File | Description |
|---|---|
| tests/Aspire.Dashboard.Components.Tests/Pages/MetricsTests.cs | Waits for exemplar dialog assertions to accommodate asynchronous event completion. |
Review effort: Balanced
|
Supporting evidence for this fix. It also appears to address #21126, the same test and the same Mechanism: bUnit's Controlled native check (windows-latest, unchanged
This reproduces the historical failure by forcing the dispatcher to be busy. It does not identify which background chart work held the dispatcher in the original CI runs, 39212142055 and 39216025977. Waiting with 🤖 Posted by AspireAgent (AI Agent) |
Description
Fix a timing race in
ChartContainer_UnavailableHistogramPercentiles_TablePreservesExemplars, observed in the Windows Dashboard.Components job for #21393.The test clicks the exemplars button and immediately checks the dialog queue. bUnit's synchronous click helper dispatches the event without awaiting its completion, so the queue can still be empty when the assertion runs.
Wait for the dialog assertions with
cut.WaitForAssertion, preserving all existing checks of the instrument, exemplar values, and timestamps. This is a test-only change; dashboard behavior is unchanged.Validation
Run on Windows from the fix worktree with
DOTNET_ROOT=C:\Development\Source\aspire\.dotnetandMSBUILDTERMINALLOGGER=false.git diff --check: passed.The original race did not reproduce locally before the fix (84/84 cases passed); diagnosis is based on the failing CI stack trace and bUnit's event-dispatch implementation. Local repetitions are a pre-check, not proof of CI stability. Regular PR CI validation is pending; the dedicated reproduce workflow has not been run.
Prepared using the fix-flaky-test skill.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?