Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public async Task AllocatedPortsAssignedAfterHookRuns()

await using var app = testProgram.Build();

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

var appModel = await tcs.Task.DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);

Expand Down Expand Up @@ -381,7 +381,7 @@ public async Task TestServicesWithMultipleReplicas()

var logger = app.Services.GetRequiredService<ILogger<DistributedApplicationTests>>();

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

logger.LogInformation("Make sure services A and C are running");
using var clientA = app.CreateHttpClient(testProgram.ServiceABuilder.Resource.Name, "http");
Expand Down Expand Up @@ -435,7 +435,7 @@ public async Task VerifyContainerArgs()

await using var app = testProgram.Build();

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

var s = app.Services.GetRequiredService<IKubernetesService>();
var list = await s.ListAsync<Container>().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
Expand Down Expand Up @@ -488,7 +488,7 @@ public async Task VerifyContainerCreateFile()

await using var app = testProgram.Build();

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

var s = app.Services.GetRequiredService<IKubernetesService>();
var list = await s.ListAsync<Container>().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
Expand Down Expand Up @@ -537,7 +537,7 @@ public async Task VerifyContainerStopStartWorks()
var orchestrator = app.Services.GetRequiredService<ApplicationOrchestrator>();
var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix;

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

using var cts = AsyncTestHelpers.CreateDefaultTimeoutTokenSource(TestConstants.DefaultOrchestratorTestLongTimeout);
var token = cts.Token;
Expand Down Expand Up @@ -580,7 +580,7 @@ public async Task VerifyExecutableStopStartWorks()
var orchestrator = app.Services.GetRequiredService<ApplicationOrchestrator>();
var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix;

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

var executablePattern = $"{testName}-servicea-{ReplicaIdRegex}-{suffix}";
var serviceA = await KubernetesHelper.GetResourceByNameMatchAsync<Executable>(kubernetes, executablePattern, r => r.Status?.State == ExecutableState.Running).DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
Expand Down Expand Up @@ -622,7 +622,7 @@ public async Task SpecifyingEnvPortInEndpointFlowsToEnv()

var kubernetes = app.Services.GetRequiredService<IKubernetesService>();

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix;
var redisContainer = await KubernetesHelper.GetResourceByNameMatchAsync<Container>(kubernetes, $"{testName}-redis-{ReplicaIdRegex}-{suffix}", r => r.Status?.EffectiveEnv is not null).DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
Expand Down Expand Up @@ -677,7 +677,7 @@ public async Task StartAsync_DashboardAuthConfig_PassedToDashboardProcess(string

var kubernetes = app.Services.GetRequiredService<IKubernetesService>();

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix;
var aspireDashboard = await KubernetesHelper.GetResourceByNameMatchAsync<Executable>(kubernetes, $"aspire-dashboard-{ReplicaIdRegex}-{suffix}", r => r.Status?.EffectiveEnv is not null).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
Expand Down Expand Up @@ -717,7 +717,7 @@ public async Task StartAsync_UnsecuredAllowAnonymous_PassedToDashboardProcess()

var kubernetes = app.Services.GetRequiredService<IKubernetesService>();

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix;
var aspireDashboard = await KubernetesHelper.GetResourceByNameMatchAsync<Executable>(kubernetes, $"aspire-dashboard-{ReplicaIdRegex}-{suffix}", r => r.Status?.EffectiveEnv is not null).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
Expand Down Expand Up @@ -748,7 +748,7 @@ public async Task VerifyDockerWithEntrypointWorks()

await using var app = testProgram.Build();

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

var s = app.Services.GetRequiredService<IKubernetesService>();

Expand Down Expand Up @@ -777,7 +777,7 @@ public async Task VerifyDockerWithBindMountWorksWithAbsolutePaths()

await using var app = testProgram.Build();

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

var s = app.Services.GetRequiredService<IKubernetesService>();

Expand Down Expand Up @@ -806,7 +806,7 @@ public async Task VerifyDockerWithBindMountWorksWithRelativePaths()

await using var app = testProgram.Build();

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

var s = app.Services.GetRequiredService<IKubernetesService>();

Expand Down Expand Up @@ -836,7 +836,7 @@ public async Task VerifyDockerWithVolumeWorksWithName()

await using var app = testProgram.Build();

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

var s = app.Services.GetRequiredService<IKubernetesService>();

Expand All @@ -862,7 +862,7 @@ public async Task KubernetesHasResourceNameForContainersAndExes()

await using var app = testProgram.Build();

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

var s = app.Services.GetRequiredService<IKubernetesService>();

Expand Down Expand Up @@ -923,7 +923,7 @@ public async Task ReplicasAndProxylessEndpointThrows()

await using var app = testProgram.Build();

var ex = await Assert.ThrowsAsync<InvalidOperationException>(async () => await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout));
var ex = await Assert.ThrowsAsync<InvalidOperationException>(async () => await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout));
var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix;
Assert.Equal($"Resource '{testName}-servicea-{suffix}' uses multiple replicas and a proxy-less endpoint 'http'. These features do not work together.", ex.Message);
}
Expand All @@ -942,7 +942,7 @@ public async Task ProxylessEndpointWithoutPortThrows()

await using var app = testProgram.Build();

var ex = await Assert.ThrowsAsync<InvalidOperationException>(async () => await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout));
var ex = await Assert.ThrowsAsync<InvalidOperationException>(async () => await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout));
var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix;
Assert.Equal($"Service '{testName}-servicea-{suffix}' needs to specify a port for endpoint 'http' since it isn't using a proxy.", ex.Message);
}
Expand All @@ -964,7 +964,7 @@ public async Task ProxylessEndpointWorks()
SetupXUnitLogging(testProgram.AppBuilder.Services);

await using var app = testProgram.Build();
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

var client = app.CreateHttpClientWithResilience($"{testName}-servicea", "http");

Expand Down Expand Up @@ -1007,7 +1007,7 @@ public async Task ProxylessAndProxiedEndpointBothWorkOnSameResource()

await using var app = testProgram.Build();

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

using var cts = AsyncTestHelpers.CreateDefaultTimeoutTokenSource(TestConstants.LongTimeoutDuration);
var token = cts.Token;
Expand Down Expand Up @@ -1076,7 +1076,7 @@ public async Task ProxylessContainerCanBeReferenced()
.WithReference(redisNoPort);

using var app = builder.Build();
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

// Wait for the application to be ready
await app.WaitForTextAsync("Application started.").DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
Expand Down Expand Up @@ -1126,7 +1126,7 @@ public async Task WithEndpointProxySupportDisablesProxies()
.WithReference(redisNoPort);

using var app = builder.Build();
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

// Wait for the application to be ready
await app.WaitForTextAsync("Application started.").DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
Expand Down Expand Up @@ -1173,7 +1173,7 @@ public async Task ProxylessContainerWithoutPortThrows()

using var app = builder.Build();

var ex = await Assert.ThrowsAsync<InvalidOperationException>(async () => await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout));
var ex = await Assert.ThrowsAsync<InvalidOperationException>(async () => await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout));
Assert.Equal($"The endpoint 'tcp' for container resource '{testName}-redis' must specify the TargetPort value", ex.Message);
}

Expand All @@ -1194,7 +1194,7 @@ public async Task AfterResourcesCreatedLifecycleHookWorks()
var kubernetesLifecycle = (KubernetesTestLifecycleHook)lifecycles.Where(l => l.GetType() == typeof(KubernetesTestLifecycleHook)).First();
kubernetesLifecycle.KubernetesService = s;

await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);

await kubernetesLifecycle.HooksCompleted.DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
}
Expand Down