You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.NET: Cover Aspire DevUI tracing and response capture - #10519
Improve regression coverage for Aspire.Hosting.AgentFramework.DevUI without changing production code.
Description & Review Guide
What are the major changes? Add tests to AspireDashboardTracingTests.cs, DevUIAggregatorHostedServiceTests.cs.
What is the impact of these changes? The change is test-only. Local .NET Release tests and formatting passed. 151 passed; lines 90.65% to 94.78%, branches 78.26% to 87.58%. Coverage figures are from the locally selected tests, not the aggregate CI report.
What do you want reviewers to focus on? Check that the tests assert observable behavior for the Aspire DevUI tracing and response capture scenarios.
Related Issue
Part of the maintainer-authorized .NET coverage effort. Issue linkage is pending human review of this draft.
AI Assistance
No material AI assistance was used.
This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.
AI assistance details: Copilot prepared and locally verified the tests and drafted the description. Human review and attestation are pending.
Contribution Checklist
The code builds clean without any errors or warnings
All unit tests pass, and I have added new tests where possible
This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The tracing tests can pass despite regressions in oversized-line handling, first-ID selection within a chunk, or sending dashboard requests without an API key.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The tests don’t verify that the first response event wins, capture resumes on the next event after an oversized one, Dashboard retries use the original trace ID, or all tracing capabilities are disabled without a Dashboard.
Without a blank line after each data: payload, the response IDs are not sent as separate server-sent events. Add a blank line after every payload, including the initial non-response payload, so the test verifies that the first response event wins.
End the oversized SSE event before the recovery payload
With only one newline between the two data: lines, the recovery payload is still part of the oversized server-sent event. Add a blank line after each payload so the test verifies that capture resumes on the next event.
Verify both Dashboard polls use the propagated trace ID
The Dashboard stub returns a pending response and then a span for any trace ID, so these assertions would still pass if either poll queried the wrong trace. Check both Dashboard lookups against the trace ID propagated to the agent to verify that the retry retrieves the original trace.
Assert all tracing-related capabilities are disabled
This only checks trace retrieval. DevUI reads instrumentation separately (falling back to tracing), so the test would still pass if /meta incorrectly advertised instrumentation as enabled without a Dashboard. Assert that all three tracing-related capabilities are false.
Each SSE payload ends with a blank line. The first-ID test still sends the first two response events in one append, and the oversized case still splits the discarded event across appends.
The indexing retry test verifies that exactly two Dashboard lookups both use the trace ID propagated to the agent.
The no-Dashboard test verifies that instrumentation, tracing, and trace_retrieval are all disabled.
All 155 Aspire DevUI unit tests passed on .NET 11 Release. Scoped formatting passed with two pre-existing informational diagnostics excluded.
End the first fragment on the byte that triggers overflow. At 80 KiB, a parser that clears its buffer at 64 KiB but forgets to discard the rest of the line would buffer the remaining x bytes. Those bytes hide the data: prefix in resp_in_tail, so the test still passes. With the split at the overflow byte, that regression would capture resp_in_tail instead of resp_completed.
Addressed the overflow-fragment finding in 406e53e70. The first append now ends at byte 65,537, including the SSE prefix. The next append starts directly with each oversized tail, so leftover filler can no longer hide the event-looking tail. Both cases still verify capture resumes at the next real event. All 155 Aspire DevUI unit tests and scoped formatting passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
Improve regression coverage for
Aspire.Hosting.AgentFramework.DevUIwithout changing production code.Description & Review Guide
AspireDashboardTracingTests.cs,DevUIAggregatorHostedServiceTests.cs.Related Issue
Part of the maintainer-authorized .NET coverage effort. Issue linkage is pending human review of this draft.
AI Assistance
AI assistance details: Copilot prepared and locally verified the tests and drafted the description. Human review and attestation are pending.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.