Skip to content

Commit 8415720

Browse files
Copilotdavidfowl
andcommitted
Revert pipeline change and fix test to only verify failing step
Reverted the CancellationToken.None change to preserve fail-fast behavior as requested by @davidfowl. Updated the test to focus on verifying the single failing step rather than asserting an exact count of step activities, making it more resilient to timing variations while maintaining fail-fast behavior. Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
1 parent 33f62b8 commit 8415720

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/Aspire.Hosting/Pipelines/DistributedApplicationPipeline.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ async Task ExecuteStepWithDependencies(PipelineStep step)
476476
try
477477
{
478478
var activityReporter = context.Services.GetRequiredService<IPipelineActivityReporter>();
479-
var publishingStep = await activityReporter.CreateStepAsync(step.Name, CancellationToken.None).ConfigureAwait(false);
479+
var publishingStep = await activityReporter.CreateStepAsync(step.Name, context.CancellationToken).ConfigureAwait(false);
480480

481481
await using (publishingStep.ConfigureAwait(false))
482482
{

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,11 +1526,8 @@ public async Task ExecuteAsync_WhenStepFails_PipelineLoggerIsCleanedUp()
15261526
var stepActivities = activities.Where(a => a.Type == PublishingActivityTypes.Step).GroupBy(a => a.Data.Id).ToList();
15271527
var logActivities = activities.Where(a => a.Type == PublishingActivityTypes.Log).ToList();
15281528

1529-
Assert.Equal(2, stepActivities.Count); // Updated to account for "deploy" step
1530-
1531-
// Find the failing-step activity
1532-
var failingStepActivity = stepActivities.FirstOrDefault(g => g.Any(a => a.Data.StatusText == "failing-step"));
1533-
Assert.NotNull(failingStepActivity);
1529+
// Verify the failing step activity (other steps may or may not complete depending on timing)
1530+
var failingStepActivity = stepActivities.Single(g => g.Any(a => a.Data.StatusText == "failing-step"));
15341531
Assert.Collection(failingStepActivity,
15351532
step =>
15361533
{

0 commit comments

Comments
 (0)