Skip to content

Commit 8314505

Browse files
Copilotdavidfowl
andauthored
Remove flaky ExecuteAsync_WithMixOfSuccessfulAndFailingStepsAtSameLevel_ThrowsAggregateException test (#12174)
* Initial plan * Add synchronization to ExecuteAsync_WithMixOfSuccessfulAndFailingStepsAtSameLevel_ThrowsAggregateException test Co-authored-by: davidfowl <[email protected]> * Fix test to focus on reliable assertions and rename appropriately Co-authored-by: davidfowl <[email protected]> * Delete flaky test and add comment referencing issue #12200 Co-authored-by: davidfowl <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: davidfowl <[email protected]>
1 parent 521cad4 commit 8314505

File tree

1 file changed

+2
-35
lines changed

1 file changed

+2
-35
lines changed

tests/Aspire.Hosting.Tests/Pipelines/DistributedApplicationPipelineTests.cs

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -631,41 +631,8 @@ public async Task ExecuteAsync_WithDuplicateAnnotationStepNames_ThrowsInvalidOpe
631631
Assert.Contains("duplicate-step", exception.Message);
632632
}
633633

634-
[Fact]
635-
public async Task ExecuteAsync_WithMixOfSuccessfulAndFailingStepsAtSameLevel_ThrowsAggregateException()
636-
{
637-
using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, publisher: "default", isDeploy: true);
638-
var pipeline = new DistributedApplicationPipeline();
639-
640-
var successfulStepExecuted = false;
641-
642-
pipeline.AddStep("successful-step", async (context) =>
643-
{
644-
successfulStepExecuted = true;
645-
await Task.CompletedTask;
646-
});
647-
648-
pipeline.AddStep("failing-step1", async (context) =>
649-
{
650-
await Task.CompletedTask;
651-
throw new InvalidOperationException("Error from step 1");
652-
});
653-
654-
pipeline.AddStep("failing-step2", async (context) =>
655-
{
656-
await Task.CompletedTask;
657-
throw new NotSupportedException("Error from step 2");
658-
});
659-
660-
var context = CreateDeployingContext(builder.Build());
661-
662-
var exception = await Assert.ThrowsAsync<AggregateException>(() => pipeline.ExecuteAsync(context));
663-
Assert.True(successfulStepExecuted, "Successful step should have executed");
664-
Assert.Contains("Multiple pipeline steps failed", exception.Message);
665-
Assert.Equal(2, exception.InnerExceptions.Count);
666-
Assert.Contains(exception.InnerExceptions, e => e.Message.Contains("failing-step1"));
667-
Assert.Contains(exception.InnerExceptions, e => e.Message.Contains("failing-step2"));
668-
}
634+
// Test for multiple failing steps at the same level removed due to inherent race conditions.
635+
// See https://github.com/dotnet/aspire/issues/12200
669636

670637
[Fact]
671638
public async Task ExecuteAsync_WithFailingStep_PreservesOriginalStackTrace()

0 commit comments

Comments
 (0)