Skip to content

Fix OTel review comments: typo, IDisposable, deduplicate completed co…#7510

Merged
Evangelink merged 2 commits intomainfrom
dev/copilot/otel-review-fixes
Mar 9, 2026
Merged

Fix OTel review comments: typo, IDisposable, deduplicate completed co…#7510
Evangelink merged 2 commits intomainfrom
dev/copilot/otel-review-fixes

Conversation

@Evangelink
Copy link
Copy Markdown
Member

…unter, add tests

  • Fix typo: _totalUnknownedTests -> _totalUnknownTests
  • Implement IDisposable on OpenTelemetryResultHandler to clean up orphaned activities
  • Make TestApplicationResult implement IDisposable to forward disposal
  • Move _totalCompletedTests.Add(1) into HandleTestResult to deduplicate
  • Add 19 unit tests for OpenTelemetryResultHandler covering all Notify methods, activity lifecycle, tag setting, disposal, and edge cases

…unter, add tests

- Fix typo: _totalUnknownedTests -> _totalUnknownTests
- Implement IDisposable on OpenTelemetryResultHandler to clean up orphaned activities
- Make TestApplicationResult implement IDisposable to forward disposal
- Move _totalCompletedTests.Add(1) into HandleTestResult to deduplicate
- Add 19 unit tests for OpenTelemetryResultHandler covering all Notify methods,
  activity lifecycle, tag setting, disposal, and edge cases
Copilot AI review requested due to automatic review settings March 9, 2026 09:15
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

Updates Microsoft.Testing.Platform’s OpenTelemetry result handling to address review feedback by fixing a typo, ensuring OTel activities are cleaned up via IDisposable, and improving counter accounting; adds unit tests to cover the handler’s notify paths and activity lifecycle.

Changes:

  • Rename _totalUnknownedTests to _totalUnknownTests.
  • Implement IDisposable on OpenTelemetryResultHandler and forward disposal from TestApplicationResult to clean up orphaned activities.
  • Deduplicate completed-test counting by moving _totalCompletedTests.Add(1) into HandleTestResult, and add comprehensive unit tests for the handler.

Reviewed changes

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

File Description
test/UnitTests/Microsoft.Testing.Platform.UnitTests/Telemetry/OpenTelemetryResultHandlerTests.cs Adds unit tests covering notify methods, activity tagging/disposal, and edge cases.
src/Platform/Microsoft.Testing.Platform/Telemetry/OpenTelemetryResultHandler.cs Fixes counter field typo, adds IDisposable to dispose orphaned activities, and deduplicates completed counter updates.
src/Platform/Microsoft.Testing.Platform/Services/TestApplicationResult.cs Implements IDisposable to dispose the OTel result handler during shutdown.

@Evangelink Evangelink enabled auto-merge March 9, 2026 11:44
@Evangelink Evangelink merged commit 4690398 into main Mar 9, 2026
10 checks passed
@Evangelink Evangelink deleted the dev/copilot/otel-review-fixes branch March 9, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants