microsoft / microsoft/aspire

[Failing test]: Aspire.Deployment.EndToEnd.Tests.AcaManagedRedisDeploymentTests.DeployStarterWithManagedRedisToAzureContainerApps

Open
#19,174 2 comments 0 reactions 0 assignees View on GitHub
area-deployment failing-test flaky-test triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Build information

Build: https://github.com/microsoft/aspire/actions/runs/31278671079
Build error leg or test failing: Aspire.Deployment.EndToEnd.Tests.AcaManagedRedisDeploymentTests.DeployStarterWithManagedRedisToAzureContainerApps
Artifact: [deployment-test-results-Deployment.EndToEnd-AcaManagedRedisDeploymentTests](https://github.com/microsoft/aspire/actions/runs/31278671079/artifacts/9027945072)

### Fill in the error message template

## Error Message

Fill the error message using [step by step known issues guidance](https://github.com/dotnet/arcade/blob/main/Documentation/Projects/Build%20Analysis/KnownIssueJsonStepByStep.md).

```json
{
"ErrorMessage": "System.InvalidOperationException : Pipeline failed unexpectedly. Terminal output:",
"ErrorPattern": "",
"BuildRetry": false,
"ExcludeConsoleLog": false
}
```

### Error details

Error details (53 lines)

```yml
Error Message: System.InvalidOperationException : Pipeline failed unexpectedly. Terminal output:
21:22:55 (push-server) ✓ push-server completed successfully
21:22:59 (provision-cache) ✗ Failed to provision cache: Deployment failed: InsufficientCapacity: Request failed due to insufficient capacity. Retry using a
different Azure Managed Redis size or region. (42.2s)
21:22:59 (provision-cache) ✗ [ERR] Step 'provision-cache' failed.
21:22:59 (provision-cache) ✗ Deployment failed: InsufficientCapacity: Request failed due to insufficient capacity. Retry using a different Azure Managed Redis
size or region.
21:27:07 (provision-infra) i [INF] Skipping deployment state save due to --clear-cache flag
21:27:07 (provision-infra) ✓ Successfully provisioned infra (263.2s)
21:27:07 (provision-infra) ✓ provision-infra completed successfully
21:27:07 (pipeline-execution) ✗ [ERR] Deployment failed: InsufficientCapacity: Request failed due to insufficient capacity. Retry using a different Azure
Managed Redis size or region.
21:27:07 (pipeline-execution) ✗ Failed
------------------------------------------------------------
✅ 20/22 steps succeeded • ❌ 2 failed • Total time: 4m 55s

Steps Summary:
Step timeline: 0s 4m 55s
│───────┬──────┬─────┬───────│
1.88ms ✓ azure-prepare-resources │╴ │
0.72ms ✓ validate-azure-container-apps │╴ │
3.36ms ✓ prepare-azure-container-apps-infra │╴ │
0.53ms ✓ before-start │╴ │
0.60ms ✓ validate-compute-environments │╴ │
4m 55s ✗ pipeline-execution │╶──────────────────────────╴│
2.19ms ✓ process-parameters │╴ │
1.17ms ✓ build-prereq │╴ │
10.15s ✓ build-webfrontend │ ╴ │
6.48s ✓ build-server │ ╴ │
2.38ms ✓ deploy-prereq │╴ │
0.24s ✓ validate-azure-login │╴ │
3.92s ✓ create-provisioning-context │╴ │
13.38s ✓ provision-server-identity │╶─╴ │
42.21s ✗ provision-cache │╶────╴ │ — Failed to provision cache: Deployment failed: InsufficientCapacity:
Request failed due to insufficient capacity. Retry using a different Azure Managed Redis size or region.
27.26s ✓ provision-infra-acr │╶──╴ │
4m 23s ✓ provision-infra │ ╶────────────────────────╴│
1.58s ✓ login-to-acr-infra-acr │ ╴ │
0.94ms ✓ push-prereq │ ╴ │
9.36s ✓ push-server │ ╴ │
0.56ms ✓ validate-build-only-container-references │╴ │
0.37s ✓ check-container-runtime │╴ │

❌ Pipeline failed
For more details, add --pipeline-log-level debug/trace to the command.
------------------------------------------------------------

\ud83d\udcc4 See logs at /home/runner/.aspire/logs/cli_20260808T212208_22b5a410.log
Stack Trace:
at Aspire.Tests.Shared.Hex1bAutomatorTestHelpers.WaitForPipelineSuccessAsync(Hex1bTerminalAutomator auto, Nullable`1 timeout) in /home/runner/work/aspire/aspire/tests/Shared/Hex1bAutomatorTestHelpers.cs:line 772
at Aspire.Deployment.EndToEnd.Tests.AcaManagedRedisDeploymentTests.DeployStarterWithManagedRedisToAzureContainerAppsCore(CancellationToken cancellationToken) in /home/runner/work/aspire/aspire/tests/Aspire.Deployment.EndToEnd.Tests/AcaManagedRedisDeploymentTests.cs:line 175
at Aspire.Deployment.EndToEnd.Tests.AcaManagedRedisDeploymentTests.DeployStarterWithManagedRedisToAzureContainerApps() in /home/runner/work/aspire/aspire/tests/Aspire.Deployment.EndToEnd.Tests/AcaManagedRedisDeploymentTests.cs:line 28
--- End of stack trace from previous location ---
```

Standard Output

```yml
Temporary workspace created at: /tmp/Aspire.Deployment.EndToEnd.Tests/Workspace/gkpvg3oq.qov
Test: DeployStarterWithManagedRedisToAzureContainerApps
Project Name: AcaRedis
Resource Group: e2e-acaredis-31278671079-1
Subscription: 731ff15d...
Workspace: /tmp/Aspire.Deployment.EndToEnd.Tests/Workspace/gkpvg3oq.qov
Step 1: Preparing environment...
Step 1b: Registering Microsoft.Cache resource provider...
Step 2: Installing Aspire CLI using Preinstalled (~/.aspire)...
Step 3: Creating React starter project with Redis...
Step 4: Navigating to project directory...
Step 5: Adding Azure Container Apps hosting package...
Step 6: Adding Azure Redis hosting package...
Step 7: Adding Azure StackExchange Redis client package to Server project...
Modifying AppHost.cs at: /tmp/Aspire.Deployment.EndToEnd.Tests/Workspace/gkpvg3oq.qov/AcaRedis/AcaRedis.AppHost/AppHost.cs
Modified AppHost.cs: replaced AddRedis with AddAzureManagedRedis, added ACA environment
New content:
var builder = DistributedApplication.CreateBuilder(args);

var cache = builder.AddAzureManagedRedis("cache");

var server = builder.AddProject("server")
.WithReference(cache)
.WaitFor(cache)
.WithHttpHealthCheck("/health")
.WithExternalHttpEndpoints();

var webfrontend = builder.AddViteApp("webfrontend", "../frontend")
.WithReference(server)
.WaitFor(server);

server.PublishWithContainerFiles(webfrontend, "wwwroot");

// Add Azure Container App Environment for deployment
builder.AddAzureContainerAppEnvironment("infra");

builder.Build().Run();

Modifying Server Program.cs at: /tmp/Aspire.Deployment.EndToEnd.Tests/Workspace/gkpvg3oq.qov/AcaRedis/AcaRedis.Server/Program.cs
Modified Server Program.cs: added WithAzureAuthentication to Redis client builder
New content:
var builder = WebApplication.CreateBuilder(args);

// Add service defaults & Aspire client integrations.
builder.AddServiceDefaults();
builder.AddRedisClientBuilder("cache")
.WithOutputCache()
.WithAzureAuthentication();

// Add services to the container.
builder.Services.AddProblemDetails();

// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();

var app = builder.Build();

// Configure the HTTP request pipeline.
app.UseExceptionHandler();

if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
}

app.UseOutputCache();

string[] summaries = ["Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"];

var api = app.MapGroup("/api");
api.MapGet("weatherforecast", () =>
{
var forecast = Enumerable.Range(1, 5).Select(index =>
new WeatherForecast
(
DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
Random.Shared.Next(-20, 55),
summaries[Random.Shared.Next(summaries.Length)]
))
.ToArray();
return forecast;
})
.CacheOutput(p => p.Expire(TimeSpan.FromSeconds(5)))
.WithName("GetWeatherForecast");

app.MapDefaultEndpoints();

app.UseFileServer();

app.Run();

record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
{
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}

Step 10: Navigating to AppHost directory...
Step 12: Starting Azure Container Apps deployment...
❌ Test failed after 00:05:47.9148280: Pipeline failed unexpectedly. Terminal output:
21:22:55 (push-server) ✓ push-server completed successfully
21:22:59 (provision-cache) ✗ Failed to provision cache: Deployment failed: InsufficientCapacity: Request failed due to insufficient capacity. Retry using a
different Azure Managed Redis size or region. (42.2s)
21:22:59 (provision-cache) ✗ [ERR] Step 'provision-cache' failed.
21:22:59 (provision-cache) ✗ Deployment failed: InsufficientCapacity: Request failed due to insufficient capacity. Retry using a different Azure Managed Redis
size or region.
21:27:07 (provision-infra) i [INF] Skipping deployment state save due to --clear-cache flag
21:27:07 (provision-infra) ✓ Successfully provisioned infra (263.2s)
21:27:07 (provision-infra) ✓ provision-infra completed successfully
21:27:07 (pipeline-execution) ✗ [ERR] Deployment failed: InsufficientCapacity: Request failed due to insufficient capacity. Retry using a different Azure
Managed Redis size or region.
21:27:07 (pipeline-execution) ✗ Failed
------------------------------------------------------------
✅ 20/22 steps succeeded • ❌ 2 failed • Total time: 4m 55s

Steps Summary:
Step timeline: 0s 4m 55s
│───────┬──────┬─────┬───────│
1.88ms ✓ azure-prepare-resources │╴ │
0.72ms ✓ validate-azure-container-apps │╴ │
3.36ms ✓ prepare-azure-container-apps-infra │╴ │
0.53ms ✓ before-start │╴ │
0.60ms ✓ validate-compute-environments │╴ │
4m 55s ✗ pipeline-execution │╶──────────────────────────╴│
2.19ms ✓ process-parameters │╴ │
1.17ms ✓ build-prereq │╴ │
10.15s ✓ build-webfrontend │ ╴ │
6.48s ✓ build-server │ ╴ │
2.38ms ✓ deploy-prereq │╴ │
0.24s ✓ validate-azure-login │╴ │
3.92s ✓ create-provisioning-context │╴ │
13.38s ✓ provision-server-identity │╶─╴ │
42.21s ✗ provision-cache │╶────╴ │ — Failed to provision cache: Deployment failed: InsufficientCapacity:
Request failed due to insufficient capacity. Retry using a different Azure Managed Redis size or region.
27.26s ✓ provision-infra-acr │╶──╴ │
4m 23s ✓ provision-infra │ ╶────────────────────────╴│
1.58s ✓ login-to-acr-infra-acr │ ╴ │
0.94ms ✓ push-prereq │ ╴ │
9.36s ✓ push-server │ ╴ │
0.56ms ✓ validate-build-only-container-references │╴ │
0.37s ✓ check-container-runtime │╴ │

❌ Pipeline failed
For more details, add --pipeline-log-level debug/trace to the command.
------------------------------------------------------------

\ud83d\udcc4 See logs at /home/runner/.aspire/logs/cli_20260808T212208_22b5a410.log

Triggering cleanup of resource group: e2e-acaredis-31278671079-1
Cleanup triggered for resource group: e2e-acaredis-31278671079-1

```

Contributor guide

Open the contributing guide

Research direction

Start with tests/Aspire.Deployment.EndToEnd.Tests/AcaManagedRedisDeploymentTests.cs, especially DeployStarterWithManagedRedisToAzureContainerAppsCore at line 175, and review the failure from provision-cache. Run the named end-to-end test and inspect the referenced deployment logs and Azure Managed Redis configuration. Done means the test no longer fails with InsufficientCapacity.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, redis
Domain
cloud, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.