Skip to content

Commit df89579

Browse files
committed
Increase timeout for applicaton start in DistributedApplicationTests
1 parent 607fc51 commit df89579

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ public async Task AllocatedPortsAssignedAfterHookRuns()
343343

344344
await using var app = testProgram.Build();
345345

346-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
346+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
347347

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

@@ -381,7 +381,7 @@ public async Task TestServicesWithMultipleReplicas()
381381

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

384-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
384+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
385385

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

436436
await using var app = testProgram.Build();
437437

438-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
438+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
439439

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

489489
await using var app = testProgram.Build();
490490

491-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
491+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
492492

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

540-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
540+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
541541

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

583-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
583+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
584584

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

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

625-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
625+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
626626

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

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

680-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
680+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
681681

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

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

720-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
720+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
721721

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

749749
await using var app = testProgram.Build();
750750

751-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
751+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
752752

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

@@ -777,7 +777,7 @@ public async Task VerifyDockerWithBindMountWorksWithAbsolutePaths()
777777

778778
await using var app = testProgram.Build();
779779

780-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
780+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
781781

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

@@ -806,7 +806,7 @@ public async Task VerifyDockerWithBindMountWorksWithRelativePaths()
806806

807807
await using var app = testProgram.Build();
808808

809-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
809+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
810810

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

@@ -836,7 +836,7 @@ public async Task VerifyDockerWithVolumeWorksWithName()
836836

837837
await using var app = testProgram.Build();
838838

839-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
839+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
840840

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

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

863863
await using var app = testProgram.Build();
864864

865-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
865+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
866866

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

@@ -923,7 +923,7 @@ public async Task ReplicasAndProxylessEndpointThrows()
923923

924924
await using var app = testProgram.Build();
925925

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

943943
await using var app = testProgram.Build();
944944

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

966966
await using var app = testProgram.Build();
967-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
967+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
968968

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

@@ -1007,7 +1007,7 @@ public async Task ProxylessAndProxiedEndpointBothWorkOnSameResource()
10071007

10081008
await using var app = testProgram.Build();
10091009

1010-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
1010+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
10111011

10121012
using var cts = AsyncTestHelpers.CreateDefaultTimeoutTokenSource(TestConstants.LongTimeoutDuration);
10131013
var token = cts.Token;
@@ -1076,7 +1076,7 @@ public async Task ProxylessContainerCanBeReferenced()
10761076
.WithReference(redisNoPort);
10771077

10781078
using var app = builder.Build();
1079-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
1079+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
10801080

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

11281128
using var app = builder.Build();
1129-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
1129+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
11301130

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

11741174
using var app = builder.Build();
11751175

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

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

1197-
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
1197+
await app.StartAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
11981198

11991199
await kubernetesLifecycle.HooksCompleted.DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
12001200
}

0 commit comments

Comments
 (0)