Skip to content

[CI Failure] Flaky: MauiBuildQueueTests.CancelQueuedResource_CompletesGracefullyAndDoesNotAcquireSemaphore asserts exact exception type but sometimes gets TaskCanceledException instead of OperationCanceledException #20284

Description

@github-actions

Build Information

Build: https://github.com/microsoft/aspire/actions/runs/35634736322
Build error leg or test failing: Tests / No-package tests (regular, Aspire.Hosting.Maui.Tests, Hosting.Maui, Hosting.Maui, tests/Aspire.Ho... / Hosting.Maui (windows-latest) / Aspire.Hosting.Maui.Tests.MauiBuildQueueTests.CancelQueuedResource_CompletesGracefullyAndDoesNotAcquireSemaphore
Pull request: #20279

Classification Analysis

The test asserts an exact exception type (OperationCanceledException) but the code path can non-deterministically throw the subclass TaskCanceledException depending on timing of the cancellation source. The PR does not touch any Maui build queue code, so this failure is unrelated to the PR's DCP/Orchestrator changes.

Failure Information

Test output
Error:
Assert.IsType() Failure: Value is not the exact type
Expected: typeof(System.OperationCanceledException)
Actual:   typeof(System.Threading.Tasks.TaskCanceledException)

Stack Trace:
at Aspire.Hosting.Maui.Tests.MauiBuildQueueTests.CancelQueuedResource_CompletesGracefullyAndDoesNotAcquireSemaphore() in D:\a\aspire\aspire\tests\Aspire.Hosting.Maui.Tests\MauiBuildQueueTests.cs:line 543
   at Aspire.Hosting.Maui.Tests.MauiBuildQueueTests.CancelQueuedResource_CompletesGracefullyAndDoesNotAcquireSemaphore() in D:\a\aspire\aspire\tests\Aspire.Hosting.Maui.Tests\MauiBuildQueueTests.cs:line 552
--- End of stack trace from previous location ---

Description

Flaky: MauiBuildQueueTests.CancelQueuedResource_CompletesGracefullyAndDoesNotAcquireSemaphore asserts exact exception type but sometimes gets TaskCanceledException instead of OperationCanceledException

Type: flaky-test

Occurrences

Date Build Job PR
2026-09-21 35634736322 Tests / No-package tests (regular, Aspire.Hosting.Maui.Tests, Hosting.Maui, Hosting.Maui, tests/Aspire.Ho... / Hosting.Maui (windows-latest) #20279

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions