409 writes to State
Aspire.Hosting (32)
ApplicationModel\CertificateAuthorityCollectionResourceExtensions.cs (1)
36State = KnownResourceStates.Active
ApplicationModel\CommandsConfigurationExtensions.cs (6)
245: s with { State = new ResourceStateSnapshot(KnownResourceStates.Building, KnownResourceStateStyles.Info) } 295State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error) 328State = new ResourceStateSnapshot(KnownResourceStates.Starting, KnownResourceStateStyles.Info) 346State = new ResourceStateSnapshot(priorState, KnownResourceStateStyles.Info) 361State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error) 373State = new ResourceStateSnapshot(KnownResourceStates.Finished, KnownResourceStateStyles.Info)
ApplicationModel\ResourceNotificationService.cs (1)
614State = KnownResourceStates.Waiting,
Ats\NotificationExports.cs (1)
103snapshot = snapshot with { State = new ResourceStateSnapshot(state, stateStyle) };
ConnectionStringBuilderExtensions.cs (3)
85State = KnownResourceStates.NotStarted, 99State = KnownResourceStates.Running 113State = KnownResourceStates.FailedToStart
Dcp\DcpExecutor.cs (2)
968State = new ResourceStateSnapshot(KnownResourceStates.NotStarted, null) 988State = new ResourceStateSnapshot(KnownResourceStates.NotStarted, null)
Dcp\ResourceSnapshotBuilder.cs (4)
52State = state, 117State = state, 182State = state, 206State = state,
ExternalServiceBuilderExtensions.cs (4)
109State = KnownResourceStates.Waiting, 147State = KnownResourceStates.FailedToStart 159State = KnownResourceStates.FailedToStart 176State = KnownResourceStates.Running
Orchestrator\ApplicationOrchestrator.cs (6)
247State = KnownResourceStates.Starting, 260State = KnownResourceStates.Starting, 621await _notificationService.PublishUpdateAsync(context.Resource, context.DcpResourceName, s => s with { State = stateSnapshot }).ConfigureAwait(false); 630await _notificationService.PublishUpdateAsync(context.Resource, s => s with { State = stateSnapshot }).ConfigureAwait(false); 669return s with { State = KnownResourceStates.Starting }; 701State = state,
Orchestrator\ParameterProcessor.cs (1)
708State = state
ParameterResourceBuilderExtensions.cs (1)
307State = KnownResourceStates.Waiting
ProjectResourceBuilderExtensions.cs (1)
1078State = KnownResourceStates.NotStarted,
TerminalResourceBuilderExtensions.cs (1)
390State = KnownResourceStates.NotStarted,
Aspire.Hosting.Azure (29)
AzureEnvironmentResourceExtensions.cs (1)
48State = KnownResourceStates.NotStarted,
AzureProvisioningController.cs (18)
1058State = new(StartingState, KnownResourceStateStyles.Info), 1201State = KnownResourceStates.NotStarted, 1912State = new(ChangingLocationState, KnownResourceStateStyles.Info) 2059State = new(CancelingState, KnownResourceStateStyles.Info) 2076State = new(AzureProvisioningStrings.ResourceStateCanceled, KnownResourceStateStyles.Info) 2100State = new(DeletingState, KnownResourceStateStyles.Info) 2132State = new(AzureProvisioningStrings.ResourceStateCanceled, KnownResourceStateStyles.Info) 2144State = new(AzureProvisioningStrings.ResourceStateFailedToDelete, KnownResourceStateStyles.Error) 2200State = new(MissingInAzureState, KnownResourceStateStyles.Error) 3729State = new(KnownResourceStates.Running, KnownResourceStateStyles.Success) 3737State = new(AzureProvisioningStrings.ResourceStateMissingSubscriptionConfiguration, KnownResourceStateStyles.Error) 3744State = new(AzureProvisioningStrings.ResourceStateCanceled, KnownResourceStateStyles.Info) 3757State = new(AzureProvisioningStrings.ResourceStateFailedToProvision, KnownResourceStateStyles.Error), 3778State = new(AzureProvisioningStrings.ResourceStateFailedToProvision, KnownResourceStateStyles.Error), 3801State = publishedTerminalState 3826State = new(AzureProvisioningStrings.ResourceStateCanceled, KnownResourceStateStyles.Info) 3875State = new("Failed to Provision Roles", KnownResourceStateStyles.Error) 4178State = state,
Provisioning\Provisioners\BicepProvisioner.cs (10)
147State = new(AzureProvisioningController.ProvisionedState, KnownResourceStateStyles.Success), 335State = new(AzureProvisioningController.WaitingForDeploymentState, KnownResourceStateStyles.Info), 449State = new(state, KnownResourceStateStyles.Error) 536State = new(AzureProvisioningController.StartingState, KnownResourceStateStyles.Info), 559State = new(AzureProvisioningController.CompilingArmTemplateState, KnownResourceStateStyles.Info) 588State = new(AzureProvisioningController.CreatingArmDeploymentState, KnownResourceStateStyles.Info), 659State = new(AzureProvisioningStrings.ResourceStateAzureDeploymentFailed, KnownResourceStateStyles.Error), 692State = new(AzureProvisioningController.WaitingForDeploymentState, KnownResourceStateStyles.Info), 833State = new(AzureProvisioningController.ProvisionedState, KnownResourceStateStyles.Success), 997State = CreateDeploymentOperationState(summary),
Aspire.Hosting.Azure.Functions (1)
DurableTask\DurableTaskResourceExtensions.cs (1)
238State = KnownResourceStates.Running,
Aspire.Hosting.Azure.Kusto (1)
AzureKustoBuilderExtensions.cs (1)
316State = KnownResourceStates.FailedToStart
Aspire.Hosting.Azure.Tests (59)
AzureEnvironmentResourceExtensionsTests.cs (59)
332State = KnownResourceStates.Running, 341State = KnownResourceStates.Running, 706await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = KnownResourceStates.Running }); 741await notifications.PublishUpdateAsync(postgres.Resource, state => state with { State = KnownResourceStates.Running }); 1364await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new("Waiting for Deployment", KnownResourceStateStyles.Info) }); 1419await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new("Creating ARM Deployment", KnownResourceStateStyles.Info) }); 1496await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new(AzureProvisioningController.WaitingForDeploymentState, KnownResourceStateStyles.Info) }); 1666await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 1704await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 1787await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new("Failed to Provision", KnownResourceStateStyles.Error) }); 1788await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 1882await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = new("Failed to Provision", KnownResourceStateStyles.Error) }); 1951await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 1952await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 1953await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2030await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2100State = KnownResourceStates.Running, 2107State = KnownResourceStates.Running, 2173await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2174await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2226await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 2227await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2228await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2287await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 2288await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2704await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 2705await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2706await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2778await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new("Failed to Provision", KnownResourceStateStyles.Error) }); 2779await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2832await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2892await notifications.PublishUpdateAsync(visibleResource, state => state with { State = KnownResourceStates.Running }); 2947await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3022State = KnownResourceStates.Running, 3082State = KnownResourceStates.Running, 3153await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3208State = KnownResourceStates.Running, 3271State = KnownResourceStates.Running, 3343State = KnownResourceStates.Running, 3398await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3399await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 3615State = KnownResourceStates.Running, 3758State = KnownResourceStates.Running, 3843await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3915await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = new("Canceled", KnownResourceStateStyles.Info) }); 3995await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = new("Canceled", KnownResourceStateStyles.Info) }); 4069await notifications.PublishUpdateAsync(postgres.Resource, state => state with { State = KnownResourceStates.Running }); 4121await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4167await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = KnownResourceStates.Running }); 4213await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4327await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 4328await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4380await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 4381await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4438await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 4439await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4440await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 4482await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 4483await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running });
Aspire.Hosting.Blazor (3)
BlazorGatewayExtensions.cs (3)
141State = KnownResourceStates.Waiting, 165State = KnownResourceStates.Waiting, 444State = gatewayState,
Aspire.Hosting.Blazor.Tests (8)
BlazorHostedExtensionsTests.cs (1)
552State = KnownResourceStates.Running
BrowserDebuggerHelperTests.cs (5)
29snapshot => snapshot with { State = KnownResourceStates.Starting }).DefaultTimeout(); 42snapshot => snapshot with { State = terminalState }).DefaultTimeout(); 61snapshot => snapshot with { State = KnownResourceStates.Starting }).DefaultTimeout(); 75snapshot => snapshot with { State = KnownResourceStates.NotStarted }).DefaultTimeout(); 98snapshot => snapshot with { State = terminalState }).DefaultTimeout();
WithBlazorAppTests.cs (2)
256State = resourceState 297State = KnownResourceStates.Running
Aspire.Hosting.Browsers (2)
BrowserLogsBuilderExtensions.cs (1)
148State = KnownResourceStates.NotStarted,
BrowserLogsSessionManager.cs (1)
391State = new ResourceStateSnapshot(stateText, stateStyle),
Aspire.Hosting.Browsers.Tests (37)
BrowserLogsBuilderExtensionsTests.cs (35)
38State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 92State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 147State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 183State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 216State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 293State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 320State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 344State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 370State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 392State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 413State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 437State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 473State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 516State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 556State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 595State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 640State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 680State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 690State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 730State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 784State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 828State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 868State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 941State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 997State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1082State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1155State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1211State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1271State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1307State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1335State = KnownResourceStates.NotStarted, 1355State = KnownResourceStates.Running 1391State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1526State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1594State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success),
src\Aspire.Hosting.Browsers\BrowserLogsBuilderExtensions.cs (1)
148State = KnownResourceStates.NotStarted,
src\Aspire.Hosting.Browsers\BrowserLogsSessionManager.cs (1)
391State = new ResourceStateSnapshot(stateText, stateStyle),
Aspire.Hosting.DevTunnels (6)
DevTunnelResourceBuilderExtensions.cs (6)
111State = KnownResourceStates.NotStarted, 196State = KnownResourceStates.Starting 675State = KnownResourceStates.NotStarted, 711State = KnownResourceStates.Starting, 728State = KnownResourceStates.Running, 789State = KnownResourceStates.Finished,
Aspire.Hosting.DevTunnels.Tests (3)
DevTunnelResourceBuilderExtensionsTests.cs (3)
441State = KnownResourceStates.Running 451State = KnownResourceStates.Finished 462State = KnownResourceStates.Running
Aspire.Hosting.EntityFrameworkCore (9)
EFResourceBuilderExtensions.cs (9)
191State = new ResourceStateSnapshot(KnownResourceStates.NotStarted, KnownResourceStateStyles.Info) 437State = KnownResourceStates.FailedToStart 473State = KnownResourceStates.Starting, 485State = KnownResourceStates.FailedToStart 497State = KnownResourceStates.Running 515State = finalState, 552State = KnownResourceStates.FailedToStart, 577State = KnownResourceStates.FailedToStart, 903State = new ResourceStateSnapshot(state, style)
Aspire.Hosting.EntityFrameworkCore.Tests (4)
EFMigrationCommandsTests.cs (4)
202State = new ResourceStateSnapshot(KnownResourceStates.Finished, KnownResourceStateStyles.Info) 232State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Info) 262State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Info) 282State = new ResourceStateSnapshot(KnownResourceStates.Finished, KnownResourceStateStyles.Info)
Aspire.Hosting.Foundry (14)
FoundryExtensions.cs (8)
297State = new ResourceStateSnapshot(KnownResourceStates.Starting, KnownResourceStateStyles.Info) 315State = KnownResourceStates.Running, 323State = KnownResourceStates.FailedToStart, 352State = new ResourceStateSnapshot($"Downloading model {model}", KnownResourceStateStyles.Info), 364State = new ResourceStateSnapshot($"Downloading model {model}: {progress:F2}%", KnownResourceStateStyles.Info) 384State = new ResourceStateSnapshot("Loading model", KnownResourceStateStyles.Info) 391State = KnownResourceStates.Running 400State = KnownResourceStates.FailedToStart
PromptAgent\AzurePromptAgentResource.cs (6)
333State = new("Waiting", KnownResourceStateStyles.Info) 339State = new("Waiting for project", KnownResourceStateStyles.Info) 346State = new("Deploying agent", KnownResourceStateStyles.Info) 360State = new("Running", KnownResourceStateStyles.Success) 369State = new("Running", KnownResourceStateStyles.Success), 382State = new("Failed to deploy", KnownResourceStateStyles.Error)
Aspire.Hosting.GitHub.Models (2)
GitHubModelsExtensions.cs (2)
59State = KnownResourceStates.Waiting, 75State = KnownResourceStates.Running,
Aspire.Hosting.Maui (6)
Lifecycle\MauiBuildQueueEventSubscriber.cs (3)
87State = s_queuedState 99State = s_buildingState 429State = s_cancelledState,
Lifecycle\UnsupportedPlatformEventSubscriber.cs (1)
36State = new ResourceStateSnapshot($"Unsupported: {annotation.Reason}", KnownResourceStateStyles.Warn)
Utilities\MauiAndroidEnvironmentAnnotation.cs (1)
121State = new ResourceStateSnapshot("Failed to configure environment", KnownResourceStateStyles.Error)
Utilities\MauiiOSEnvironmentAnnotation.cs (1)
121State = new ResourceStateSnapshot("Failed to configure environment", KnownResourceStateStyles.Error)
Aspire.Hosting.Maui.Tests (4)
MauiBuildQueueTests.cs (4)
576State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error) 644State = new ResourceStateSnapshot("Building", KnownResourceStateStyles.Info) 662State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success) 768State = state
Aspire.Hosting.OpenAI (4)
OpenAIExtensions.cs (4)
70State = KnownResourceStates.Waiting, 86State = KnownResourceStates.Running, 119State = KnownResourceStates.Waiting, 132State = KnownResourceStates.Running,
Aspire.Hosting.Testing.Tests (4)
DashboardUrlTests.cs (2)
112snapshot => snapshot with { State = initialState }); 140snapshot => snapshot with { State = updatedState });
ResourceLoggerForwarderServiceTests.cs (2)
56await resourceNotificationService.PublishUpdateAsync(myresource, snapshot => snapshot with { State = "Running" }); 106await resourceNotificationService.PublishUpdateAsync(myresource, snapshot => snapshot with { State = "Running" });
Aspire.Hosting.Tests (159)
Backchannel\AppHostBackchannelTests.cs (1)
62State = new ("Running", null),
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (27)
136State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success) 140State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success) 183State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 348State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 405State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 454State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 516State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 545State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 592State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 619State = new ResourceStateSnapshot("Stopping", KnownResourceStateStyles.Info), 662State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 690State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 733State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 758State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 822State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success) 826State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 882State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 1035State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 1098State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 1114State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 1151State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 1223State = new ResourceStateSnapshot("Failed to Provision Roles", KnownResourceStateStyles.Error) 1358State = new ResourceStateSnapshot("Running", null) 1394State = new ResourceStateSnapshot("Running", null) 1440State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success) 1479State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success) 2171State = KnownResourceStates.Running,
Codespaces\CodespacesUrlRewriterTests.cs (1)
75State = KnownResourceStates.Running,
Dashboard\DashboardResourceTests.cs (1)
734await resourceNotificationService.PublishUpdateAsync(dashboard, "aspire-dashboard-0", s => s with { State = "Running" }).DefaultTimeout();
Dashboard\DashboardServiceDataTerminalTests.cs (5)
35await notifications.PublishUpdateAsync(resource, s => s with { State = new ResourceStateSnapshot("Running", null) }).DefaultTimeout(); 50await notifications.PublishUpdateAsync(resource, s => s with { State = new ResourceStateSnapshot("Running", null) }).DefaultTimeout(); 87await notifications.PublishUpdateAsync(resource, "myapp-ccc", s => s with { State = new ResourceStateSnapshot("Running", null) }).DefaultTimeout(); 110await notifications.PublishUpdateAsync(resource, s => s with { State = new ResourceStateSnapshot("Running", null) }).DefaultTimeout(); 135await notifications.PublishUpdateAsync(resource, "myapp-unknown", s => s with { State = new ResourceStateSnapshot("Running", null) }).DefaultTimeout();
Dashboard\DashboardServiceTests.cs (4)
207return s with { State = new ResourceStateSnapshot("Starting", null) }; 312return s with { State = new ResourceStateSnapshot("Running", null) }; 371return s with { State = new ResourceStateSnapshot("Running", null) }; 434return s with { State = new ResourceStateSnapshot("Running", null) };
Health\ResourceHealthCheckServiceTests.cs (22)
35State = new ResourceStateSnapshot(KnownResourceStates.Starting, null) 43State = new ResourceStateSnapshot(KnownResourceStates.Running, null) 75State = new ResourceStateSnapshot(KnownResourceStates.Starting, null) 83State = new ResourceStateSnapshot(KnownResourceStates.Running, null) 118State = new ResourceStateSnapshot(KnownResourceStates.Starting, null) 126State = new ResourceStateSnapshot(KnownResourceStates.Running, null) 165State = new ResourceStateSnapshot(KnownResourceStates.Running, null) 180State = new ResourceStateSnapshot(KnownResourceStates.Exited, null) 188State = new ResourceStateSnapshot(KnownResourceStates.Running, null), 231State = KnownResourceStates.Running 272State = KnownResourceStates.Running 315State = KnownResourceStates.Running 351State = new ResourceStateSnapshot(KnownResourceStates.Running, null) 382State = new ResourceStateSnapshot(KnownResourceStates.Running, null) 444State = new ResourceStateSnapshot(KnownResourceStates.Running, null) 489State = new ResourceStateSnapshot(KnownResourceStates.Running, null) 540State = new ResourceStateSnapshot(KnownResourceStates.Running, null) 548State = new ResourceStateSnapshot(KnownResourceStates.Running, null) 584State = new ResourceStateSnapshot(KnownResourceStates.Starting, null) 592State = new ResourceStateSnapshot(KnownResourceStates.Running, null) 630State = new ResourceStateSnapshot(KnownResourceStates.Starting, null) 638State = new ResourceStateSnapshot(KnownResourceStates.Running, null)
Lifecycle\TerminalHostFailureDiagnosticServiceTests.cs (6)
34State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, null), 73State = new ResourceStateSnapshot(KnownResourceStates.Exited, null), 104State = new ResourceStateSnapshot(KnownResourceStates.Exited, null), 145State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, null), 183State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, null), 198State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, null),
Orchestrator\ApplicationOrchestratorTests.cs (9)
684State = KnownResourceStates.Running 699State = KnownResourceStates.Building 912await resourceNotificationService.PublishUpdateAsync(waiter.Resource, s => s with { State = KnownResourceStates.Starting }).DefaultTimeout(); 972await resourceNotificationService.PublishUpdateAsync(waiter.Resource, s => s with { State = KnownResourceStates.Starting }); 1074await notificationService.PublishUpdateAsync(resource, instance.Name, s => s with { State = state }).DefaultTimeout(); 1089State = KnownResourceStates.NotStarted, 1107State = KnownResourceStates.Running, 1314snapshot => snapshot with { State = KnownResourceStates.FailedToStart })); 1361snapshot => snapshot with { State = KnownResourceStates.FailedToStart }));
ResourceCommandAnnotationTests.cs (2)
65State = resourceState 145State = resourceState
ResourceNotificationTests.cs (54)
154(snapshot with { State = KnownResourceStates.Running }).WithHealthReports( 241await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 257await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 271await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 287await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = KnownResourceStates.Running }).DefaultTimeout(); 302await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeOtherState" }).DefaultTimeout(); 317await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeOtherState" }).DefaultTimeout(); 334await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 381State = KnownResourceStates.Running 394State = KnownResourceStates.Running 430State = KnownResourceStates.Running, 448State = KnownResourceStates.Running, 485State = KnownResourceStates.Finished, 499State = KnownResourceStates.Finished, 523State = KnownResourceStates.NotStarted 539State = KnownResourceStates.Running 564await notificationService.PublishUpdateAsync(resource, s => s with { State = state }).DefaultTimeout(); 571State = KnownResourceStates.Running 599State = KnownResourceStates.Starting 603State = KnownResourceStates.NotStarted 619State = KnownResourceStates.Running 641State = KnownResourceStates.NotStarted 649State = KnownResourceStates.Running 674State = KnownResourceStates.NotStarted 689State = KnownResourceStates.Running 713State = KnownResourceStates.NotStarted 728State = KnownResourceStates.Running 761State = KnownResourceStates.Running 774State = KnownResourceStates.Running 791State = KnownResourceStates.Waiting, 800State = KnownResourceStates.Running 816State = KnownResourceStates.Running 821State = KnownResourceStates.Waiting, 849State = KnownResourceStates.Starting 912await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 923await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 933await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "NewState" }).DefaultTimeout(); 943await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = null }).DefaultTimeout(); 953await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "" }).DefaultTimeout(); 963await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = " " }).DefaultTimeout(); 982await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 1068State = "Running" // Change something else to trigger an update 1113State = "Starting" 1149State = "Starting" 1280State = KnownResourceStates.Running 1286State = KnownResourceStates.Running, 1325State = KnownResourceStates.Running, 1350State = KnownResourceStates.Running 1358State = KnownResourceStates.Running, 1414await notificationService.PublishUpdateAsync(resourceBuilder.Resource, snapshot => snapshot with { State = state, ExitCode = exitCode }).DefaultTimeout(); 1458await notificationService.PublishUpdateAsync(resource, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 1462await notificationService.PublishUpdateAsync(resource, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 1467await notificationService.PublishUpdateAsync(resource, snapshot => snapshot with { State = "SomeOtherState" }).DefaultTimeout(); 1490State = "SomeState",
WaitForTests.cs (19)
112State = KnownResourceStates.Running 143State = KnownResourceStates.Running 183State = KnownResourceStates.Running 221State = status 332State = status 366State = status 374State = KnownResourceStates.Running 413State = status 421State = KnownResourceStates.Running 461State = KnownResourceStates.Finished, 508State = KnownResourceStates.Finished, 563State = KnownResourceStates.Running 617State = KnownResourceStates.Finished, 666State = KnownResourceStates.Running, 674State = KnownResourceStates.Running, 719State = KnownResourceStates.Finished, 727State = KnownResourceStates.Finished, 768State = KnownResourceStates.Finished 880State = KnownResourceStates.Running
WithHttpCommandTests.cs (6)
629State = KnownResourceStates.Running 952State = KnownResourceStates.Starting 964State = KnownResourceStates.Running 1007State = KnownResourceStates.Running 1022State = KnownResourceStates.Running 1061State = KnownResourceStates.Running
WithUrlsTests.cs (2)
548State = KnownResourceStates.NotStarted, 580State = KnownResourceStates.Running
CustomResources.AppHost (13)
TalkingClockResource.cs (11)
45State = KnownResourceStates.NotStarted, // Use an Aspire well-known state. 79State = KnownResourceStates.Running // Use an Aspire well-known state. 84State = "Waiting on clock tick" // Custom state string for the tick hand. 89State = "Waiting on clock tock" // Custom state string for the tock hand. 101s => s with { State = new ResourceStateSnapshot("Tick", KnownResourceStateStyles.Success) }); 103s => s with { State = new ResourceStateSnapshot("On", KnownResourceStateStyles.Success) }); 105s => s with { State = new ResourceStateSnapshot("Off", KnownResourceStateStyles.Info) }); 111s => s with { State = new ResourceStateSnapshot("Tock", KnownResourceStateStyles.Success) }); 113s => s with { State = new ResourceStateSnapshot("Off", KnownResourceStateStyles.Info) }); 115s => s with { State = new ResourceStateSnapshot("On", KnownResourceStateStyles.Success) }); 134State = KnownResourceStates.NotStarted,
TestResource.cs (2)
20State = "Starting", 67State = new(randomState, randomStyle)
HealthChecksSandbox.AppHost (3)
AppHost.cs (3)
72State = "Starting", 115State = "Starting", 137state => state with { State = new("Running", "success") });
Stress.AppHost (6)
TestResource.cs (6)
21State = "Starting", 39State = "Starting", 58State = "Running", 75State = "Running", 108State = "Running", 181State = randomState
297 references to State
Aspire.Hosting (78)
ApplicationModel\CommandsConfigurationExtensions.cs (7)
37var state = context.ResourceSnapshot.State?.Text; 70var state = context.ResourceSnapshot.State?.Text; 110var state = context.ResourceSnapshot.State?.Text; 174var state = context.ResourceSnapshot.State?.Text; 225preRebuildStates[name] = evt.Snapshot.State?.Text; 243s.State?.Text == KnownResourceStates.Waiting 281KnownResourceStates.TerminalStates.Contains(evt.Snapshot.State?.Text))
ApplicationModel\CustomResourceSnapshot.cs (3)
98HealthStatus = ComputeHealthStatus(value, State?.Text); 187State != other.State ||
ApplicationModel\ResourceCommandAnnotation.cs (2)
430State = snapshot.State?.Text, 431StateStyle = snapshot.State?.Style,
ApplicationModel\ResourceNotificationService.cs (35)
133re => re.Snapshot.State?.Text is { Length: > 0 } stateText && targetStates.Contains(stateText, StringComparers.ResourceState), 137var finalState = resourceEvent.Snapshot.State!.Text!; 291snapshot.State?.Text == KnownResourceStates.Finished || 292snapshot.State?.Text == KnownResourceStates.Exited || 293snapshot.State?.Text == KnownResourceStates.FailedToStart || 294snapshot.State?.Text == KnownResourceStates.RuntimeUnhealthy, 335if (snapshot.State?.Text == KnownResourceStates.FailedToStart) 344else if ((snapshot.State!.Text == KnownResourceStates.Finished || snapshot.State!.Text == KnownResourceStates.Exited) && snapshot.ExitCode is not null && snapshot.ExitCode != exitCode) 349snapshot.State.Text, 355$"Resource '{resource.Name}' stopped waiting for dependency resource '{displayName}' because it entered the '{snapshot.State.Text}' state with exit code '{snapshot.ExitCode}', expected '{exitCode}'." 367KnownResourceStates.TerminalStates.Contains(snapshot.State?.Text) || 401if (snapshot.State?.Text == KnownResourceStates.FailedToStart) 410else if (snapshot.State!.Text == KnownResourceStates.Finished || 411snapshot.State.Text == KnownResourceStates.Exited || 412snapshot.State.Text == KnownResourceStates.RuntimeUnhealthy) 417snapshot.State.Text 421$"Resource '{resource.Name}' stopped waiting for dependency resource '{displayName}' because it entered the '{snapshot.State.Text}' state prematurely." 437WaitBehavior.WaitOnResourceUnavailable => snapshot.State?.Text == KnownResourceStates.Running, 438WaitBehavior.StopOnResourceUnavailable => snapshot.State?.Text == KnownResourceStates.Running || 439snapshot.State?.Text == KnownResourceStates.Finished || 440snapshot.State?.Text == KnownResourceStates.Exited || 441snapshot.State?.Text == KnownResourceStates.FailedToStart || 442snapshot.State?.Text == KnownResourceStates.RuntimeUnhealthy, 611CanTransitionToWaiting(s.State?.Text, allowNotStarted) 842if (!string.Equals(newState.State?.Text, KnownResourceStates.Waiting, StringComparisons.ResourceState)) 890if (_logger.IsEnabled(LogLevel.Debug) && newState.State?.Text is { Length: > 0 } newStateText && !string.IsNullOrWhiteSpace(newStateText)) 892var previousStateText = previousState?.State?.Text; 929newState.State?.Text, 930newState.State?.Style, 989var previousState = previousSnapshot?.State?.Text; 990var newState = snapshot.State?.Text; 1208HiddenBehavior.OnCompletion => IsCompletionState(previousState.State?.Text) 1294WriteValue("Current State", snapshot.State?.Text); 1332error.Append(CultureInfo.InvariantCulture, $" - {dependencyName}: State = {dependencyEvent.Snapshot.State?.Text ?? "(null)"}");
Ats\NotificationExports.cs (2)
155State = resourceEvent.Snapshot.State?.Text, 156StateStyle = resourceEvent.Snapshot.State?.Style,
Backchannel\AppHostRpcTarget.cs (2)
145var healthStatus = CustomResourceSnapshot.ComputeHealthStatus(resourceEvent.Snapshot.HealthReports, resourceEvent.Snapshot.State?.Text); 151State = resourceEvent.Snapshot.State?.Text ?? "Unknown",
Backchannel\AuxiliaryBackchannelRpcTarget.cs (9)
702State = resourceEvent.Snapshot.State?.Text, 712re => re.Snapshot.State?.Text == KnownResourceStates.Running || 713KnownResourceStates.TerminalStates.Contains(re.Snapshot.State?.Text, StringComparers.ResourceState) || 714string.Equals(re.Snapshot.State?.Style, KnownResourceStateStyles.Error, StringComparisons.ResourceState) || 719var state = resourceEvent.Snapshot.State?.Text; 736re => KnownResourceStates.TerminalStates.Contains(re.Snapshot.State?.Text) || re.Snapshot.ExitCode is not null, 743State = resourceEvent.Snapshot.State?.Text, 1190State = snapshot.State?.Text, 1192StateStyle = snapshot.State?.Style,
Dashboard\DashboardServiceData.cs (2)
83State = snapshot.State?.Text, 84StateStyle = snapshot.State?.Style,
Dcp\DcpExecutor.cs (1)
880initial.InitialSnapshot.State?.Text is string state && !string.IsNullOrEmpty(state))
Diagnostics\ProfilingTelemetry.cs (3)
1039SetTag(Tags.ResourceState, snapshot.State?.Text); 1109if (snapshot.State?.Text is { } state) 1155if (snapshot.State?.Text is { } state)
DistributedApplication.cs (2)
837var value = $@"Type = {Resource.GetType().Name}, Name = ""{Resource.Name}"", State = {Snapshot?.State?.Text ?? "(null)"}"; 844if (KnownResourceStates.TerminalStates.Contains(Snapshot?.State?.Text, StringComparers.ResourceState))
Health\ResourceHealthCheckService.cs (5)
42if (resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running) 73else if (KnownResourceStates.TerminalStates.Contains(resourceEvent.Snapshot.State?.Text)) 85&& KnownResourceStates.TerminalStates.Contains(evt.Snapshot.State?.Text)); 397if (currentEvent.Snapshot.State?.Text == previousEvent.Snapshot.State?.Text)
Lifecycle\TerminalHostFailureDiagnosticService.cs (1)
66var state = evt.Snapshot.State?.Text;
Orchestrator\ApplicationOrchestrator.cs (3)
162if (e.Snapshot.State?.Text == KnownResourceStates.Waiting) 586previousState = previousResourceEvent.Snapshot.State?.Text; 666if (s.State?.Text == KnownResourceStates.Waiting)
ResourceBuilderExtensions.cs (1)
3702var resourceState = context.ResourceSnapshot.State?.Text;
Aspire.Hosting.Azure (6)
AzureProvisioningController.cs (6)
990var state = snapshot.State?.Text; 996var state = snapshot.State?.Text; 2161environmentEvent.Snapshot.State?.Text != KnownResourceStates.Running) 3387return resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running; 3835string.Equals(currentEvent.Snapshot.State?.Text, state, StringComparison.Ordinal); 3841currentEvent.Snapshot.State is { Text: { } stateText } currentState &&
Aspire.Hosting.Azure.Kusto (2)
AzureKustoBuilderExtensions.cs (2)
365return context.ResourceSnapshot.State?.Text == KnownResourceStates.Running ? ResourceCommandState.Enabled : ResourceCommandState.Disabled; 376return context.ResourceSnapshot.State?.Text == KnownResourceStates.Running ? ResourceCommandState.Enabled : ResourceCommandState.Disabled;
Aspire.Hosting.Azure.Tests (51)
AzureBicepProvisionerTests.cs (3)
1179Assert.Equal("Azure deployment failed", resourceEvent.Snapshot.State?.Text); 1294Assert.Equal("Azure deployment failed", resourceEvent.Snapshot.State?.Text); 1762Assert.Equal("Azure deployment canceled", resourceEvent.Snapshot.State?.Text);
AzureEnvironmentResourceExtensionsTests.cs (48)
381Assert.Equal(KnownResourceStates.NotStarted, environmentEvent.Snapshot.State?.Text); 385Assert.Equal(KnownResourceStates.NotStarted, storageEvent.Snapshot.State?.Text); 497Assert.Equal("Running", storageEvent.Snapshot.State?.Text); 570Assert.Equal(KnownResourceStates.Running, storageEvent.Snapshot.State?.Text); 1386Assert.Equal("Canceled", storageEvent.Snapshot.State?.Text); 1724Assert.Equal(KnownResourceStates.Running, storageEvent.Snapshot.State?.Text); 1827Assert.Equal(KnownResourceStates.NotStarted, storageEvent.Snapshot.State?.Text); 1830Assert.Equal(KnownResourceStates.Running, storage2Event.Snapshot.State?.Text); 1909Assert.Equal(KnownResourceStates.NotStarted, keyVaultEvent.Snapshot.State?.Text); 1975Assert.Equal("Deleting", storageEvent.Snapshot.State?.Text); 2063Assert.Equal("Canceled", storageEvent.Snapshot.State?.Text); 2136Assert.Equal(KnownResourceStates.NotStarted, storageEvent.Snapshot.State?.Text); 2141Assert.Equal(KnownResourceStates.Running, storage2Event.Snapshot.State?.Text); 2198Assert.Equal("Running", storageEvent.Snapshot.State?.Text); 2201Assert.Equal(KnownResourceStates.Running, storage2Event.Snapshot.State?.Text); 2478Assert.Equal("Canceling", storageEvent.Snapshot.State?.Text); 2481Assert.Equal("Canceling", blobsEvent.Snapshot.State?.Text); 2490Assert.Equal("Canceled", storageEvent.Snapshot.State?.Text); 2557storageEvent.Snapshot.State?.Text is "Canceling" or "Canceled", 2558$"Expected storage to be canceling or canceled, but it was '{storageEvent.Snapshot.State?.Text}'."); 2560Assert.Equal("Running", storage2Event.Snapshot.State?.Text); 2565Assert.Equal("Running", storage2Event.Snapshot.State?.Text); 3040Assert.Equal(KnownResourceStates.Running, storageEvent.Snapshot.State?.Text); 3485Assert.Equal(KnownResourceStates.Running, environmentEvent.Snapshot.State?.Text); 3936Assert.Equal("Running", keyVaultEvent.Snapshot.State?.Text); 4040Assert.Equal("Failed to Provision", keyVaultEvent.Snapshot.State?.Text); 4247Assert.Equal("Failed to Provision", storageEvent.Snapshot.State?.Text); 4333Assert.Equal(AzureProvisioningController.DriftedState, environmentEvent.Snapshot.State?.Text); 4334Assert.Equal(KnownResourceStateStyles.Error, environmentEvent.Snapshot.State?.Style); 4342Assert.Equal(AzureProvisioningController.MissingInAzureState, resourceEvent.Snapshot.State?.Text); 4343Assert.Equal(KnownResourceStateStyles.Error, resourceEvent.Snapshot.State?.Style); 4386Assert.Equal(KnownResourceStates.Running, environmentEvent.Snapshot.State?.Text); 4389Assert.Equal(KnownResourceStates.Running, resourceEvent.Snapshot.State?.Text); 4445Assert.Equal(AzureProvisioningController.DriftedState, environmentEvent.Snapshot.State?.Text); 4448Assert.Equal(KnownResourceStates.Running, storageEvent.Snapshot.State?.Text); 4451Assert.Equal(AzureProvisioningController.MissingInAzureState, storage2Event.Snapshot.State?.Text); 4452Assert.Equal(KnownResourceStateStyles.Error, storage2Event.Snapshot.State?.Style); 4488Assert.Equal(KnownResourceStates.Running, environmentEvent.Snapshot.State?.Text); 4491Assert.Equal(KnownResourceStates.Running, resourceEvent.Snapshot.State?.Text); 4685Assert.Equal("Failed to Delete", environmentEvent.Snapshot.State?.Text); 4752Assert.Equal("Failed to Provision", storageEvent.Snapshot.State?.Text); 4755Assert.Equal("Failed to Provision", storageRolesEvent.Snapshot.State?.Text); 4823Assert.Equal(AzureProvisioningController.CancelingState, storageEvent.Snapshot.State?.Text); 4829Assert.Equal(AzureProvisioningStrings.ResourceStateCanceled, storageEvent.Snapshot.State?.Text); 4830Assert.Equal(KnownResourceStateStyles.Info, storageEvent.Snapshot.State?.Style); 4853Assert.Equal("Failed to Provision", environmentEvent.Snapshot.State?.Text); 5159resourceEvent.Snapshot.State?.Text == expectedState) 5175? finalEvent.Snapshot.State?.Text
Aspire.Hosting.Blazor (3)
BlazorGatewayExtensions.cs (1)
432var gatewayState = resourceEvent.Snapshot.State;
BrowserDebuggerHelper.cs (2)
221&& ctx.ResourceSnapshot.State?.Text == KnownResourceStates.Running 307var state = evt.Snapshot.State?.Text;
Aspire.Hosting.Blazor.Tests (1)
AddBlazorWasmAppTests.cs (1)
35Assert.Equal(KnownResourceStates.Waiting, state.State);
Aspire.Hosting.Browsers (3)
BrowserLogsBuilderExtensions.cs (3)
179var childState = context.ResourceSnapshot.State?.Text; 188var parentState = resourceEvent.Snapshot.State?.Text; 278var childState = context.ResourceSnapshot.State?.Text;
Aspire.Hosting.Browsers.Tests (19)
BrowserLogsBuilderExtensionsTests.cs (16)
965resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1014resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1035resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1099resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1112resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1174resourceEvent.Snapshot.State?.Text == KnownResourceStates.FailedToStart && 1227resourceEvent.Snapshot.State?.Text == KnownResourceStates.FailedToStart && 1236resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1287resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1411resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1447resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1479resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1495resourceEvent.Snapshot.State?.Text == KnownResourceStates.Finished && 1501Assert.Equal(KnownResourceStates.Finished, allCompletedEvent.Snapshot.State?.Text); 1548resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1564resourceEvent.Snapshot.State?.Text == KnownResourceStates.Exited &&
src\Aspire.Hosting.Browsers\BrowserLogsBuilderExtensions.cs (3)
179var childState = context.ResourceSnapshot.State?.Text; 188var parentState = resourceEvent.Snapshot.State?.Text; 278var childState = context.ResourceSnapshot.State?.Text;
Aspire.Hosting.Containers.Tests (2)
DockerSocketBindMountTests.cs (2)
43e => KnownResourceStates.TerminalStates.Contains(e.Snapshot.State?.Text), 46Assert.Equal(KnownResourceStates.Exited, state.Snapshot.State);
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
621context.ResourceSnapshot.State?.Text == KnownResourceStates.Running &&
Aspire.Hosting.DevTunnels.Tests (1)
DevTunnelResourceBuilderExtensionsTests.cs (1)
630e => e.Snapshot.State?.Text == KnownResourceStates.Running &&
Aspire.Hosting.EntityFrameworkCore (4)
EFCoreOperationExecutor.cs (4)
320r => r.Snapshot.State?.Text == KnownResourceStates.Finished || 321r.Snapshot.State?.Text == KnownResourceStates.Exited || 322r.Snapshot.State?.Text == KnownResourceStates.FailedToStart, 353if ((exitCode != null && exitCode.Value != 0) || snapshot.State?.Text == KnownResourceStates.FailedToStart)
Aspire.Hosting.EntityFrameworkCore.Tests (1)
AddEFMigrationsTests.cs (1)
194Assert.Equal("NotStarted", snapshotAnnotation.InitialSnapshot.State?.Text);
Aspire.Hosting.Maui (5)
Lifecycle\MauiBuildQueueEventSubscriber.cs (5)
294var text = e.Snapshot.State?.Text; 367var state = context.ResourceSnapshot.State?.Text; 402e => string.Equals(e.Snapshot.State?.Text, KnownResourceStates.FailedToStart, StringComparison.Ordinal), 422if (s.State?.Text is not null && s.State.Text != KnownResourceStates.FailedToStart)
Aspire.Hosting.Maui.Tests (3)
MauiBuildQueueTests.cs (3)
129if (evt.Resource.Name == env.MacCatalyst.Name && evt.Snapshot.State?.Text == "Queued") 163if (evt.Resource.Name == env.Android.Name && evt.Snapshot.State?.Text == "Building") 791if (evt.Resource.Name == resource.Name && evt.Snapshot.State?.Text == state)
Aspire.Hosting.Testing.Tests (2)
DashboardUrlTests.cs (2)
107resourceEvent => resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running, 135resourceEvent => resourceEvent.Snapshot.State?.Text == updatedState,
Aspire.Hosting.Tests (114)
AddConnectionStringTests.cs (1)
67Assert.Equal(KnownResourceStates.NotStarted, state.State?.Text);
Dcp\ResourceSnapshotBuilderTests.cs (2)
227Assert.Equal(KnownResourceStates.NotStarted, snapshot.State?.Text); 257Assert.Equal(KnownResourceStates.NotStarted, snapshot.State?.Text);
DistributedApplicationTests.cs (32)
209var resourceEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Waiting, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 213await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 217await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Finished, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 221await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Waiting, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 225await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 255var notStartedResourceEvent = await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 256var dependentResourceEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Waiting, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 277var runningResourceEvent = await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 285var dependentResourceRunningEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 294await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Finished, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 298await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 349await rns.WaitForResourceAsync(normalResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); 352await rns.WaitForResourceAsync(explicitStartResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, token).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); 392var notStartedResourceEvent = await rns.WaitForResourceAsync(explicitStartResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 401await rns.WaitForResourceAsync(explicitStartResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); 546e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, 551e => e.Snapshot.State?.Text == KnownResourceStates.Waiting, 573var runningResourceEvent = await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 580var dependentRunningResourceEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 589await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Exited, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 593await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 635notStartedResourceEvent = await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 636dependentResourceEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Waiting, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 658var runningResourceEvent = await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 665var dependentRunningResourceEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 674await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Exited, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 681await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 1106var dependentRunningResourceEvent = await rns.WaitForResourceAsync(container.Resource.Name, e => e.Snapshot.State?.Text == KnownResourceStates.Running).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 2111var state = e.Snapshot.State?.Text; 2120var state = e.Snapshot.State?.Text; 2156e => e.Snapshot.State?.Text == KnownResourceStates.Running && 2161e => e.Snapshot.State?.Text == KnownResourceStates.Running &&
ExternalServiceTests.cs (6)
342e => e.Snapshot.State?.Text == KnownResourceStates.FailedToStart 346Assert.Equal(KnownResourceStates.FailedToStart, resourceEvent.Snapshot.State?.Text); 369e => e.Snapshot.State?.Text == KnownResourceStates.FailedToStart 373Assert.Equal(KnownResourceStates.FailedToStart, resourceEvent.Snapshot.State?.Text); 396e => e.Snapshot.State?.Text == KnownResourceStates.Running 400Assert.Equal(KnownResourceStates.Running, resourceEvent.Snapshot.State?.Text);
Health\ResourceHealthCheckServiceTests.cs (9)
38var startingEvent = await app.ResourceNotifications.WaitForResourceAsync("resource", e => e.Snapshot.State?.Text == KnownResourceStates.Starting).DefaultTimeout(); 78var startingEvent = await app.ResourceNotifications.WaitForResourceAsync("resource", e => e.Snapshot.State?.Text == KnownResourceStates.Starting).DefaultTimeout(); 86var runningEvent = await app.ResourceNotifications.WaitForResourceAsync("resource", e => e.Snapshot.State?.Text == KnownResourceStates.Running).DefaultTimeout(); 121var startingEvent = await app.ResourceNotifications.WaitForResourceAsync("resource", e => e.Snapshot.State?.Text == KnownResourceStates.Starting).DefaultTimeout(); 130e => e.Snapshot.State?.Text == KnownResourceStates.Running && e.Snapshot.HealthReports.Single().Status == HealthStatus.Unhealthy).DefaultTimeout(); 587var startingEvent = await app.ResourceNotifications.WaitForResourceAsync("resource", e => e.Snapshot.State?.Text == KnownResourceStates.Starting).DefaultTimeout(); 596var runningEvent = await app.ResourceNotifications.WaitForResourceAsync("resource", e => e.Snapshot.State?.Text == KnownResourceStates.Running).DefaultTimeout(); 633var startingEvent = await app.ResourceNotifications.WaitForResourceAsync("resource", e => e.Snapshot.State?.Text == KnownResourceStates.Starting).DefaultTimeout(); 641var runningEvent = await app.ResourceNotifications.WaitForResourceAsync("resource", e => e.Snapshot.State?.Text == KnownResourceStates.Running).DefaultTimeout();
Orchestrator\ApplicationOrchestratorTests.cs (23)
519Assert.Equal(KnownResourceStates.FailedToStart, snapshotEvent.Snapshot.State?.Text); 520Assert.Equal(KnownResourceStateStyles.Error, snapshotEvent.Snapshot.State?.Style); 547Assert.Equal(KnownResourceStates.FailedToStart, snapshotEvent.Snapshot.State?.Text); 548Assert.Null(snapshotEvent.Snapshot.State?.Style); 571Assert.Equal(KnownResourceStates.Starting, snapshotEvent.Snapshot.State?.Text); 603Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 644Assert.NotEqual(KnownResourceStates.Running, dependencyEvent.Snapshot.State?.Text); 692e => e.ResourceId == "waiter-abc123" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 750e => e.ResourceId == "waiter-abc123" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 754Assert.Equal(KnownResourceStates.NotStarted, siblingEvent.Snapshot.State?.Text); 801e => e.ResourceId == "waiter-abc123" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 855e => e.ResourceId == "waiter-abc123" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 863e => e.ResourceId == "waiter-def456" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 917Assert.NotEqual(KnownResourceStates.Running, blockerEvent.Snapshot.State?.Text); 966|| waiterEvent.Snapshot.State?.Text != KnownResourceStates.Waiting) 983Assert.NotEqual(KnownResourceStates.Running, blockerEvent.Snapshot.State?.Text); 1050re => re.Snapshot.State?.Text == KnownResourceStates.Waiting, 1317var parentState = resourceNotificationService.TryGetCurrentState("parent-container-dcp", out var parentEvent) ? parentEvent.Snapshot.State?.Text : null; 1318var childContainerState = resourceNotificationService.TryGetCurrentState(childContainer.Resource.Name, out var childContainerEvent) ? childContainerEvent.Snapshot.State?.Text : null; 1319var customChildState = resourceNotificationService.TryGetCurrentState(customChild.Resource.Name, out var customChildEvent) ? customChildEvent.Snapshot.State?.Text : null; 1364var parentState = resourceNotificationService.TryGetCurrentState("parent-container-dcp", out var parentEvent) ? parentEvent.Snapshot.State?.Text : null; 1365var childProjectState = resourceNotificationService.TryGetCurrentState(childProject.Resource.Name, out var childProjectEvent) ? childProjectEvent.Snapshot.State?.Text : null; 1366var customChildState = resourceNotificationService.TryGetCurrentState(customChild.Resource.Name, out var customChildEvent) ? customChildEvent.Snapshot.State?.Text : null;
Orchestrator\ParameterProcessorTests.cs (4)
105Assert.Equal(KnownResourceStates.Running, snapshot.State?.Text); 263Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 267Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 271Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text);
ResourceCommandServiceTests.cs (1)
1650await resourceNotificationService.WaitForResourceAsync(project.Resource.Name, e => KnownResourceStates.BuildableStates.Contains(e.Snapshot.State?.Text), cts.Token).DefaultTimeout(TimeSpan.FromMinutes(2));
ResourceNotificationTests.cs (25)
373re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 377Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 386re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 421re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 425Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 439re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 477re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 481Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 491re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 531re => re.Snapshot.State?.Text == KnownResourceStates.Waiting, 534Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 577Assert.Equal(state, resourceEvent.Snapshot.State?.Text); 611re => re.ResourceId == "resource-abc123" && re.Snapshot.State?.Text == KnownResourceStates.Waiting, 615Assert.Equal(KnownResourceStates.NotStarted, notStartedEvent.Snapshot.State?.Text); 625Assert.Equal(KnownResourceStates.NotStarted, notStartedEvent.Snapshot.State?.Text); 655Assert.Equal(KnownResourceStates.NotStarted, notStartedEvent.Snapshot.State?.Text); 682re => re.Snapshot.State?.Text == KnownResourceStates.Waiting, 721re => re.ResourceId == "resource-abc123" && re.Snapshot.State?.Text == KnownResourceStates.Waiting, 753re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 766re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 857re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 1084Assert.Equal("Running", secondEvent.Snapshot.State?.Text); 1121Assert.Equal("Starting", value.Snapshot.State?.Text); 1157Assert.Equal("Starting", value.Snapshot.State?.Text); 1471Assert.Equal("SomeOtherState", changed.Snapshot.State?.Text);
WithHttpCommandTests.cs (4)
957e => e.Snapshot.State?.Text == KnownResourceStates.Starting).DefaultTimeout(); 970e => e.Snapshot.State?.Text == KnownResourceStates.Running && 1013e => e.Snapshot.State?.Text == KnownResourceStates.Running && 1069e => e.Snapshot.State?.Text == KnownResourceStates.Running &&
WithUrlsTests.cs (7)
447e => e.Snapshot.State == KnownResourceStates.Running 483testOutputHelper.WriteLine($"Captured snapshot #{urlSnapshots.Count}: State={notification.Snapshot.State}, URLs: {FormatUrls(notification.Snapshot.Urls)}"); 486if (notification.Snapshot.State == KnownResourceStates.Running && 599testOutputHelper.WriteLine($"Captured snapshot #{urlSnapshots.Count}: State={notification.Snapshot.State}, URLs: {FormatUrls(notification.Snapshot.Urls)}"); 602if (notification.Snapshot.State == KnownResourceStates.Running && 673e => e.Snapshot.State == KnownResourceStates.Running && e.Snapshot.Urls.Length == 4).DefaultTimeout(); 974e => e.Snapshot.State == KnownResourceStates.Running
Aspire.Playground.Tests (1)
Infrastructure\DistributedApplicationExtensions.cs (1)
107return Task.WhenAll(applicationModel.Resources.Select(r => app.ResourceNotifications.WaitForResourceAsync(r.Name, r => targetStates?.Contains(r.Snapshot.State?.Text, StringComparer.OrdinalIgnoreCase) is true || r.Snapshot.IsHidden, cancellationToken)));