489 writes to State
Aspire.Hosting (33)
ApplicationModel\CertificateAuthorityCollectionResourceExtensions.cs (1)
36State = KnownResourceStates.Active
ApplicationModel\CommandsConfigurationExtensions.cs (7)
238: s with { State = new ResourceStateSnapshot(KnownResourceStates.Building, KnownResourceStateStyles.Info) } 283State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error) 297State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error) 330State = new ResourceStateSnapshot(KnownResourceStates.Starting, KnownResourceStateStyles.Info) 348State = new ResourceStateSnapshot(priorState, KnownResourceStateStyles.Info) 363State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error) 375State = new ResourceStateSnapshot(KnownResourceStates.Finished, KnownResourceStateStyles.Info)
ApplicationModel\ResourceNotificationService.cs (1)
643State = 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)
1006State = new ResourceStateSnapshot(KnownResourceStates.NotStarted, null) 1027State = 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)
245State = KnownResourceStates.Starting, 258State = KnownResourceStates.Starting, 611await _notificationService.PublishUpdateAsync(context.Resource, context.DcpResourceName, s => s with { State = stateSnapshot }).ConfigureAwait(false); 620await _notificationService.PublishUpdateAsync(context.Resource, s => s with { State = stateSnapshot }).ConfigureAwait(false); 659return s with { State = KnownResourceStates.Starting }; 691State = state,
Orchestrator\ParameterProcessor.cs (1)
705State = state
ParameterResourceBuilderExtensions.cs (1)
305State = KnownResourceStates.Waiting
ProjectResourceBuilderExtensions.cs (1)
1125State = KnownResourceStates.NotStarted,
TerminalResourceBuilderExtensions.cs (1)
368State = KnownResourceStates.NotStarted,
Aspire.Hosting.Azure (29)
AzureEnvironmentResourceExtensions.cs (1)
45State = KnownResourceStates.NotStarted,
AzureProvisioningController.cs (18)
1055State = new(StartingState, KnownResourceStateStyles.Info), 1198State = KnownResourceStates.NotStarted, 1909State = new(ChangingLocationState, KnownResourceStateStyles.Info) 2056State = new(CancelingState, KnownResourceStateStyles.Info) 2073State = new(AzureProvisioningStrings.ResourceStateCanceled, KnownResourceStateStyles.Info) 2097State = new(DeletingState, KnownResourceStateStyles.Info) 2129State = new(AzureProvisioningStrings.ResourceStateCanceled, KnownResourceStateStyles.Info) 2141State = new(AzureProvisioningStrings.ResourceStateFailedToDelete, KnownResourceStateStyles.Error) 2197State = new(MissingInAzureState, KnownResourceStateStyles.Error) 3726State = new(KnownResourceStates.Running, KnownResourceStateStyles.Success) 3734State = new(AzureProvisioningStrings.ResourceStateMissingSubscriptionConfiguration, KnownResourceStateStyles.Error) 3741State = new(AzureProvisioningStrings.ResourceStateCanceled, KnownResourceStateStyles.Info) 3754State = new(AzureProvisioningStrings.ResourceStateFailedToProvision, KnownResourceStateStyles.Error), 3775State = new(AzureProvisioningStrings.ResourceStateFailedToProvision, KnownResourceStateStyles.Error), 3798State = publishedTerminalState 3823State = new(AzureProvisioningStrings.ResourceStateCanceled, KnownResourceStateStyles.Info) 3872State = new("Failed to Provision Roles", KnownResourceStateStyles.Error) 4175State = state,
Provisioning\Provisioners\BicepProvisioner.cs (10)
143State = new(AzureProvisioningController.ProvisionedState, KnownResourceStateStyles.Success), 331State = new(AzureProvisioningController.WaitingForDeploymentState, KnownResourceStateStyles.Info), 445State = new(state, KnownResourceStateStyles.Error) 532State = new(AzureProvisioningController.StartingState, KnownResourceStateStyles.Info), 555State = new(AzureProvisioningController.CompilingArmTemplateState, KnownResourceStateStyles.Info) 584State = new(AzureProvisioningController.CreatingArmDeploymentState, KnownResourceStateStyles.Info), 655State = new(AzureProvisioningStrings.ResourceStateAzureDeploymentFailed, KnownResourceStateStyles.Error), 688State = new(AzureProvisioningController.WaitingForDeploymentState, KnownResourceStateStyles.Info), 829State = new(AzureProvisioningController.ProvisionedState, KnownResourceStateStyles.Success), 993State = CreateDeploymentOperationState(summary),
Aspire.Hosting.Azure.Functions (1)
DurableTask\DurableTaskResourceExtensions.cs (1)
242State = KnownResourceStates.Running,
Aspire.Hosting.Azure.Kusto (1)
AzureKustoBuilderExtensions.cs (1)
316State = KnownResourceStates.FailedToStart
Aspire.Hosting.Azure.Tests (59)
AzureEnvironmentResourceExtensionsTests.cs (59)
329State = KnownResourceStates.Running, 338State = KnownResourceStates.Running, 703await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = KnownResourceStates.Running }); 738await notifications.PublishUpdateAsync(postgres.Resource, state => state with { State = KnownResourceStates.Running }); 1361await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new("Waiting for Deployment", KnownResourceStateStyles.Info) }); 1416await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new("Creating ARM Deployment", KnownResourceStateStyles.Info) }); 1493await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new(AzureProvisioningController.WaitingForDeploymentState, KnownResourceStateStyles.Info) }); 1663await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 1701await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 1784await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new("Failed to Provision", KnownResourceStateStyles.Error) }); 1785await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 1879await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = new("Failed to Provision", KnownResourceStateStyles.Error) }); 1948await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 1949await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 1950await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2027await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2097State = KnownResourceStates.Running, 2104State = KnownResourceStates.Running, 2170await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2171await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2223await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 2224await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2225await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2284await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 2285await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2701await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 2702await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2703await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2775await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new("Failed to Provision", KnownResourceStateStyles.Error) }); 2776await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2829await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2889await notifications.PublishUpdateAsync(visibleResource, state => state with { State = KnownResourceStates.Running }); 2944await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3019State = KnownResourceStates.Running, 3079State = KnownResourceStates.Running, 3150await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3205State = KnownResourceStates.Running, 3268State = KnownResourceStates.Running, 3340State = KnownResourceStates.Running, 3395await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3396await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 3612State = KnownResourceStates.Running, 3755State = KnownResourceStates.Running, 3840await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3912await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = new("Canceled", KnownResourceStateStyles.Info) }); 3992await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = new("Canceled", KnownResourceStateStyles.Info) }); 4066await notifications.PublishUpdateAsync(postgres.Resource, state => state with { State = KnownResourceStates.Running }); 4118await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4164await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = KnownResourceStates.Running }); 4210await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4324await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 4325await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4377await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 4378await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4435await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 4436await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4437await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 4479await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 4480await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running });
Aspire.Hosting.Blazor (3)
BlazorGatewayExtensions.cs (3)
198State = KnownResourceStates.Waiting, 222State = KnownResourceStates.Waiting, 532State = gatewayState,
Aspire.Hosting.Blazor.Tests (8)
BlazorHostedExtensionsTests.cs (1)
627State = 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)
390State = new ResourceStateSnapshot(stateText, stateStyle),
Aspire.Hosting.Browsers.Tests (37)
BrowserLogsBuilderExtensionsTests.cs (35)
37State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 91State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 146State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 182State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 215State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 292State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 319State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 343State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 369State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 391State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 412State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 436State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 472State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 515State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 555State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 594State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 639State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 679State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 689State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 729State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 783State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 827State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 867State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 940State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 996State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1081State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1154State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1210State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1270State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1306State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1334State = KnownResourceStates.NotStarted, 1354State = KnownResourceStates.Running 1390State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1525State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success), 1593State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success),
src\Aspire.Hosting.Browsers\BrowserLogsBuilderExtensions.cs (1)
148State = KnownResourceStates.NotStarted,
src\Aspire.Hosting.Browsers\BrowserLogsSessionManager.cs (1)
390State = new ResourceStateSnapshot(stateText, stateStyle),
Aspire.Hosting.DevTunnels (5)
DevTunnelResourceBuilderExtensions.cs (5)
109State = KnownResourceStates.NotStarted, 201State = KnownResourceStates.Starting 704State = KnownResourceStates.NotStarted, 746State = KnownResourceStates.Running, 834State = KnownResourceStates.Finished,
Aspire.Hosting.DevTunnels.Tests (5)
DevTunnelMonitorTests.cs (1)
479await test.App.ResourceNotifications.PublishUpdateAsync(test.Tunnel, s => s with { State = KnownResourceStates.FailedToStart });
DevTunnelResourceBuilderExtensionsTests.cs (3)
545State = KnownResourceStates.Running 555State = KnownResourceStates.Finished 566State = KnownResourceStates.Running
TestDevTunnelMonitor.cs (1)
60await App.ResourceNotifications.PublishUpdateAsync(Tunnel, s => s with { State = KnownResourceStates.Running });
Aspire.Hosting.Dotnet.Tests (26)
DotnetProjectBuildCoordinatorTests.cs (26)
229State = KnownResourceStates.Finished, 246State = KnownResourceStates.Finished, 445State = KnownResourceStates.Finished, 1438State = KnownResourceStates.Finished, 1692State = KnownResourceStates.Finished, 1792State = KnownResourceStates.Finished, 1807State = KnownResourceStates.Finished, 1922State = KnownResourceStates.Finished, 2046State = KnownResourceStates.Finished, 2083State = KnownResourceStates.Finished, 2693State = state, 3202State = KnownResourceStates.Finished, 3207State = KnownResourceStates.Finished, 3300State = KnownResourceStates.Finished, 3308State = finalState, 3315State = KnownResourceStates.Running, 3322State = KnownResourceStates.Finished, 3358State = KnownResourceStates.Finished, 3380State = KnownResourceStates.Finished, 3385State = KnownResourceStates.NotStarted 3393State = KnownResourceStates.Running, 3400State = KnownResourceStates.Exited, 3442State = KnownResourceStates.Finished, 3477State = KnownResourceStates.Finished, 3498State = KnownResourceStates.Finished, 3654snapshot => snapshot with { State = KnownResourceStates.Waiting });
Aspire.Hosting.EntityFrameworkCore (9)
EFResourceBuilderExtensions.cs (9)
281State = new ResourceStateSnapshot(KnownResourceStates.NotStarted, KnownResourceStateStyles.Info) 523State = KnownResourceStates.FailedToStart 559State = KnownResourceStates.Starting, 571State = KnownResourceStates.FailedToStart 583State = KnownResourceStates.Running 601State = finalState, 638State = KnownResourceStates.FailedToStart, 663State = KnownResourceStates.FailedToStart, 987State = new ResourceStateSnapshot(state, style)
Aspire.Hosting.EntityFrameworkCore.Tests (5)
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)
TestServices\TestEfTool.cs (1)
38State = Result.Success ? KnownResourceStates.Finished : KnownResourceStates.FailedToStart,
Aspire.Hosting.Foundry (20)
FoundryExtensions.cs (9)
351State = new ResourceStateSnapshot(KnownResourceStates.Starting, KnownResourceStateStyles.Info) 371State = KnownResourceStates.Running, 379State = KnownResourceStates.FailedToStart, 411State = new ResourceStateSnapshot(manageModel ? $"Preparing model {model}" : $"Using existing model {model}", KnownResourceStateStyles.Info), 430State = new ResourceStateSnapshot("Loading model", KnownResourceStateStyles.Info) 449State = KnownResourceStates.Running, 459State = KnownResourceStates.FailedToStart 467State = new ResourceStateSnapshot($"Downloading model {model}", KnownResourceStateStyles.Info) 478State = new ResourceStateSnapshot($"Downloading model {model}: {progress:F2}%", KnownResourceStateStyles.Info)
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)
Toolbox\FoundryToolboxResource.cs (5)
335State = new("Waiting for dependencies", KnownResourceStateStyles.Info) 345State = new( 357State = new("Waiting for Toolbox tools", KnownResourceStateStyles.Info) 382State = new(KnownResourceStates.Running, KnownResourceStateStyles.Success), 406State = new(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error)
Aspire.Hosting.Foundry.Tests (1)
ToolboxTests.cs (1)
929State = KnownResourceStates.FailedToStart
Aspire.Hosting.Maui (6)
Lifecycle\MauiBuildQueueEventSubscriber.cs (3)
115State = s_queuedState 127State = s_buildingState 588State = s_cancelledState,
Lifecycle\UnsupportedPlatformEventSubscriber.cs (1)
36State = new ResourceStateSnapshot($"Unsupported: {annotation.Reason}", KnownResourceStateStyles.Warn)
Utilities\MauiAndroidEnvironmentAnnotation.cs (1)
109State = new ResourceStateSnapshot("Failed to configure environment", KnownResourceStateStyles.Error)
Utilities\MauiiOSEnvironmentAnnotation.cs (1)
109State = new ResourceStateSnapshot("Failed to configure environment", KnownResourceStateStyles.Error)
Aspire.Hosting.Maui.Tests (12)
MauiBuildQueueTests.cs (8)
582State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error) 649State = new ResourceStateSnapshot("Building", KnownResourceStateStyles.Info) 670State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success) 719State = new ResourceStateSnapshot("Building", KnownResourceStateStyles.Info) 737State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success) 745State = new ResourceStateSnapshot("Terminated", KnownResourceStateStyles.Success) 917State = new ResourceStateSnapshot("Terminated", KnownResourceStateStyles.Success) 1142State = state
MauiPlatformExtensionsTests.cs (4)
924State = KnownResourceStates.Running, 1221State = KnownResourceStates.Running 1332State = KnownResourceStates.Running 1348State = dashboardState
Aspire.Hosting.MongoDB (8)
ReplicaSet\MongoDBReplicaSetBuilderExtensions.cs (8)
100State = KnownResourceStates.Waiting, 118State = KnownResourceStates.FailedToStart, 136State = KnownResourceStates.Starting, 361State = KnownResourceStates.Running, 369State = KnownResourceStates.FailedToStart, 497? s with { State = KnownResourceStates.Exited } 519? s with { State = KnownResourceStates.Starting } 536? s with { State = KnownResourceStates.Running }
Aspire.Hosting.MongoDB.Tests (4)
ReplicaSet\AddMongoDBReplicaSetTests.cs (2)
338State = KnownResourceStates.Running 345State = KnownResourceStates.Exited
tests\Shared\ContainerReplCommandTestBase.cs (2)
59State = state is null ? null : new ResourceStateSnapshot(state, null), 78State = state,
Aspire.Hosting.MySql.Tests (2)
tests\Shared\ContainerReplCommandTestBase.cs (2)
59State = state is null ? null : new ResourceStateSnapshot(state, null), 78State = state,
Aspire.Hosting.OpenAI (4)
OpenAIExtensions.cs (4)
70State = KnownResourceStates.Waiting, 86State = KnownResourceStates.Running, 119State = KnownResourceStates.Waiting, 132State = KnownResourceStates.Running,
Aspire.Hosting.PostgreSQL.Tests (2)
tests\Shared\ContainerReplCommandTestBase.cs (2)
59State = state is null ? null : new ResourceStateSnapshot(state, null), 78State = state,
Aspire.Hosting.Redis.Tests (2)
tests\Shared\ContainerReplCommandTestBase.cs (2)
59State = state is null ? null : new ResourceStateSnapshot(state, null), 78State = state,
Aspire.Hosting.SqlServer.Tests (2)
tests\Shared\ContainerReplCommandTestBase.cs (2)
59State = state is null ? null : new ResourceStateSnapshot(state, null), 78State = state,
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 (175)
Backchannel\AppHostBackchannelTests.cs (1)
81State = 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)
746await 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)
212return s with { State = new ResourceStateSnapshot("Starting", null) }; 317return s with { State = new ResourceStateSnapshot("Running", null) }; 376return s with { State = new ResourceStateSnapshot("Running", null) }; 439return 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 (11)
42snapshot => snapshot with { State = snapshotState }); 69snapshot => snapshot with { State = state is not null ? new(state, null) : snapshot.State, ExitCode = state == KnownResourceStates.Finished ? 0 : null })); 729State = KnownResourceStates.Running 744State = KnownResourceStates.Building 957await resourceNotificationService.PublishUpdateAsync(waiter.Resource, s => s with { State = KnownResourceStates.Starting }).DefaultTimeout(); 1017await resourceNotificationService.PublishUpdateAsync(waiter.Resource, s => s with { State = KnownResourceStates.Starting }); 1119await notificationService.PublishUpdateAsync(resource, instance.Name, s => s with { State = state }).DefaultTimeout(); 1134State = KnownResourceStates.NotStarted, 1152State = KnownResourceStates.Running, 1360snapshot => snapshot with { State = KnownResourceStates.FailedToStart })); 1408snapshot => snapshot with { State = KnownResourceStates.FailedToStart }));
ResourceCommandAnnotationTests.cs (3)
71State = resourceState 151State = resourceState 228State = new ResourceStateSnapshot(state, null),
ResourceNotificationTests.cs (67)
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(); 272await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 287await notificationService.PublishUpdateAsync(resource, snapshot => snapshot with { State = "SomeOtherState" }).DefaultTimeout(); 309await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = KnownResourceStates.Running }).DefaultTimeout(); 331await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeOtherState" }).DefaultTimeout(); 357await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeOtherState" }).DefaultTimeout(); 374await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 427State = KnownResourceStates.Running 440State = KnownResourceStates.Running 476State = KnownResourceStates.Running, 494State = KnownResourceStates.Running, 531State = KnownResourceStates.Finished, 545State = KnownResourceStates.Finished, 569State = KnownResourceStates.NotStarted 585State = KnownResourceStates.Running 610await notificationService.PublishUpdateAsync(resource, s => s with { State = state }).DefaultTimeout(); 617State = KnownResourceStates.Running 645State = KnownResourceStates.Starting 649State = KnownResourceStates.NotStarted 665State = KnownResourceStates.Running 687State = KnownResourceStates.NotStarted 695State = KnownResourceStates.Running 720State = KnownResourceStates.NotStarted 735State = KnownResourceStates.Running 759State = KnownResourceStates.NotStarted 774State = KnownResourceStates.Running 807State = KnownResourceStates.Running 820State = KnownResourceStates.Running 837State = KnownResourceStates.Waiting, 846State = KnownResourceStates.Running 862State = KnownResourceStates.Running 867State = KnownResourceStates.Waiting, 895State = KnownResourceStates.Starting 958await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 969await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 979await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "NewState" }).DefaultTimeout(); 989await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = null }).DefaultTimeout(); 999await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "" }).DefaultTimeout(); 1009await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = " " }).DefaultTimeout(); 1028await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 1114State = "Running" // Change something else to trigger an update 1159State = "Starting" 1195State = "Starting" 1326State = KnownResourceStates.Running 1332State = KnownResourceStates.Running, 1371State = KnownResourceStates.Running, 1396State = KnownResourceStates.Running 1404State = KnownResourceStates.Running, 1430State = KnownResourceStates.Running, 1453State = KnownResourceStates.Starting 1467State = KnownResourceStates.Running 1493State = KnownResourceStates.Running 1541State = KnownResourceStates.Running 1559State = KnownResourceStates.Running 1581State = KnownResourceStates.Running 1602State = KnownResourceStates.Running, 1620State = KnownResourceStates.Running, 1637State = KnownResourceStates.Running, 1653State = KnownResourceStates.Running, 1658State = KnownResourceStates.FailedToStart 1705await notificationService.PublishUpdateAsync(resourceBuilder.Resource, snapshot => snapshot with { State = state, ExitCode = exitCode }).DefaultTimeout(); 1749await notificationService.PublishUpdateAsync(resource, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 1753await notificationService.PublishUpdateAsync(resource, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 1758await notificationService.PublishUpdateAsync(resource, snapshot => snapshot with { State = "SomeOtherState" }).DefaultTimeout(); 1781State = "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)
568State = KnownResourceStates.NotStarted, 600State = KnownResourceStates.Running
Aspire.Hosting.Valkey.Tests (2)
tests\Shared\ContainerReplCommandTestBase.cs (2)
59State = state is null ? null : new ResourceStateSnapshot(state, null), 78State = state,
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
358 references to State
Aspire.Hosting (78)
ApplicationModel\CommandsConfigurationExtensions.cs (8)
38var state = context.ResourceSnapshot.State?.Text; 71var state = context.ResourceSnapshot.State?.Text; 112var state = context.ResourceSnapshot.State?.Text; 166var state = context.ResourceSnapshot.State?.Text; 218preRebuildStates[name] = evt.Snapshot.State?.Text; 236s.State?.Text == KnownResourceStates.Waiting 277if (terminalEvent.Snapshot.State?.Text == KnownResourceStates.FailedToStart) 390var state = resourceEvent.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)
128re => re.Snapshot.State?.Text is { Length: > 0 } stateText && targetStates.Contains(stateText, StringComparers.ResourceState), 138var finalState = resourceEvent.Snapshot.State!.Text!; 320snapshot.State?.Text == KnownResourceStates.Finished || 321snapshot.State?.Text == KnownResourceStates.Exited || 322snapshot.State?.Text == KnownResourceStates.FailedToStart || 323snapshot.State?.Text == KnownResourceStates.RuntimeUnhealthy, 364if (snapshot.State?.Text == KnownResourceStates.FailedToStart) 373else if ((snapshot.State!.Text == KnownResourceStates.Finished || snapshot.State!.Text == KnownResourceStates.Exited) && snapshot.ExitCode is not null && snapshot.ExitCode != exitCode) 378snapshot.State.Text, 384$"Resource '{resource.Name}' stopped waiting for dependency resource '{displayName}' because it entered the '{snapshot.State.Text}' state with exit code '{snapshot.ExitCode}', expected '{exitCode}'." 396KnownResourceStates.TerminalStates.Contains(snapshot.State?.Text) || 430if (snapshot.State?.Text == KnownResourceStates.FailedToStart) 439else if (snapshot.State!.Text == KnownResourceStates.Finished || 440snapshot.State.Text == KnownResourceStates.Exited || 441snapshot.State.Text == KnownResourceStates.RuntimeUnhealthy) 446snapshot.State.Text 450$"Resource '{resource.Name}' stopped waiting for dependency resource '{displayName}' because it entered the '{snapshot.State.Text}' state prematurely." 466WaitBehavior.WaitOnResourceUnavailable => snapshot.State?.Text == KnownResourceStates.Running, 467WaitBehavior.StopOnResourceUnavailable => snapshot.State?.Text == KnownResourceStates.Running || 468snapshot.State?.Text == KnownResourceStates.Finished || 469snapshot.State?.Text == KnownResourceStates.Exited || 470snapshot.State?.Text == KnownResourceStates.FailedToStart || 471snapshot.State?.Text == KnownResourceStates.RuntimeUnhealthy, 640CanTransitionToWaiting(s.State?.Text, allowNotStarted) 879if (!string.Equals(newState.State?.Text, KnownResourceStates.Waiting, StringComparisons.ResourceState)) 927if (_logger.IsEnabled(LogLevel.Debug) && newState.State?.Text is { Length: > 0 } newStateText && !string.IsNullOrWhiteSpace(newStateText)) 929var previousStateText = previousState?.State?.Text; 966newState.State?.Text, 967newState.State?.Style, 1026var previousState = previousSnapshot?.State?.Text; 1027var newState = snapshot.State?.Text; 1245HiddenBehavior.OnCompletion => IsCompletionState(previousState.State?.Text) 1331WriteValue("Current State", snapshot.State?.Text); 1369error.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)
724State = resourceEvent.Snapshot.State?.Text, 734re => re.Snapshot.State?.Text == KnownResourceStates.Running || 735KnownResourceStates.TerminalStates.Contains(re.Snapshot.State?.Text, StringComparers.ResourceState) || 736string.Equals(re.Snapshot.State?.Style, KnownResourceStateStyles.Error, StringComparisons.ResourceState) || 741var state = resourceEvent.Snapshot.State?.Text; 758re => KnownResourceStates.TerminalStates.Contains(re.Snapshot.State?.Text) || re.Snapshot.ExitCode is not null, 765State = resourceEvent.Snapshot.State?.Text, 1212State = snapshot.State?.Text, 1214StateStyle = snapshot.State?.Style,
Dashboard\DashboardServiceData.cs (2)
83State = snapshot.State?.Text, 84StateStyle = snapshot.State?.Style,
Dcp\DcpExecutor.cs (1)
916initial.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)
849var value = $@"Type = {Resource.GetType().Name}, Name = ""{Resource.Name}"", State = {Snapshot?.State?.Text ?? "(null)"}"; 856if (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 (2)
162if (e.Snapshot.State?.Text == KnownResourceStates.Waiting) 656if (s.State?.Text == KnownResourceStates.Waiting)
ResourceBuilderExtensions.cs (1)
4073var resourceState = context.ResourceSnapshot.State?.Text;
Aspire.Hosting.Azure (6)
AzureProvisioningController.cs (6)
987var state = snapshot.State?.Text; 993var state = snapshot.State?.Text; 2158environmentEvent.Snapshot.State?.Text != KnownResourceStates.Running) 3384return resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running; 3832string.Equals(currentEvent.Snapshot.State?.Text, state, StringComparison.Ordinal); 3838currentEvent.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)
1176Assert.Equal("Azure deployment failed", resourceEvent.Snapshot.State?.Text); 1291Assert.Equal("Azure deployment failed", resourceEvent.Snapshot.State?.Text); 1759Assert.Equal("Azure deployment canceled", resourceEvent.Snapshot.State?.Text);
AzureEnvironmentResourceExtensionsTests.cs (48)
378Assert.Equal(KnownResourceStates.NotStarted, environmentEvent.Snapshot.State?.Text); 382Assert.Equal(KnownResourceStates.NotStarted, storageEvent.Snapshot.State?.Text); 494Assert.Equal("Running", storageEvent.Snapshot.State?.Text); 567Assert.Equal(KnownResourceStates.Running, storageEvent.Snapshot.State?.Text); 1383Assert.Equal("Canceled", storageEvent.Snapshot.State?.Text); 1721Assert.Equal(KnownResourceStates.Running, storageEvent.Snapshot.State?.Text); 1824Assert.Equal(KnownResourceStates.NotStarted, storageEvent.Snapshot.State?.Text); 1827Assert.Equal(KnownResourceStates.Running, storage2Event.Snapshot.State?.Text); 1906Assert.Equal(KnownResourceStates.NotStarted, keyVaultEvent.Snapshot.State?.Text); 1972Assert.Equal("Deleting", storageEvent.Snapshot.State?.Text); 2060Assert.Equal("Canceled", storageEvent.Snapshot.State?.Text); 2133Assert.Equal(KnownResourceStates.NotStarted, storageEvent.Snapshot.State?.Text); 2138Assert.Equal(KnownResourceStates.Running, storage2Event.Snapshot.State?.Text); 2195Assert.Equal("Running", storageEvent.Snapshot.State?.Text); 2198Assert.Equal(KnownResourceStates.Running, storage2Event.Snapshot.State?.Text); 2475Assert.Equal("Canceling", storageEvent.Snapshot.State?.Text); 2478Assert.Equal("Canceling", blobsEvent.Snapshot.State?.Text); 2487Assert.Equal("Canceled", storageEvent.Snapshot.State?.Text); 2554storageEvent.Snapshot.State?.Text is "Canceling" or "Canceled", 2555$"Expected storage to be canceling or canceled, but it was '{storageEvent.Snapshot.State?.Text}'."); 2557Assert.Equal("Running", storage2Event.Snapshot.State?.Text); 2562Assert.Equal("Running", storage2Event.Snapshot.State?.Text); 3037Assert.Equal(KnownResourceStates.Running, storageEvent.Snapshot.State?.Text); 3482Assert.Equal(KnownResourceStates.Running, environmentEvent.Snapshot.State?.Text); 3933Assert.Equal("Running", keyVaultEvent.Snapshot.State?.Text); 4037Assert.Equal("Failed to Provision", keyVaultEvent.Snapshot.State?.Text); 4244Assert.Equal("Failed to Provision", storageEvent.Snapshot.State?.Text); 4330Assert.Equal(AzureProvisioningController.DriftedState, environmentEvent.Snapshot.State?.Text); 4331Assert.Equal(KnownResourceStateStyles.Error, environmentEvent.Snapshot.State?.Style); 4339Assert.Equal(AzureProvisioningController.MissingInAzureState, resourceEvent.Snapshot.State?.Text); 4340Assert.Equal(KnownResourceStateStyles.Error, resourceEvent.Snapshot.State?.Style); 4383Assert.Equal(KnownResourceStates.Running, environmentEvent.Snapshot.State?.Text); 4386Assert.Equal(KnownResourceStates.Running, resourceEvent.Snapshot.State?.Text); 4442Assert.Equal(AzureProvisioningController.DriftedState, environmentEvent.Snapshot.State?.Text); 4445Assert.Equal(KnownResourceStates.Running, storageEvent.Snapshot.State?.Text); 4448Assert.Equal(AzureProvisioningController.MissingInAzureState, storage2Event.Snapshot.State?.Text); 4449Assert.Equal(KnownResourceStateStyles.Error, storage2Event.Snapshot.State?.Style); 4485Assert.Equal(KnownResourceStates.Running, environmentEvent.Snapshot.State?.Text); 4488Assert.Equal(KnownResourceStates.Running, resourceEvent.Snapshot.State?.Text); 4682Assert.Equal("Failed to Delete", environmentEvent.Snapshot.State?.Text); 4749Assert.Equal("Failed to Provision", storageEvent.Snapshot.State?.Text); 4752Assert.Equal("Failed to Provision", storageRolesEvent.Snapshot.State?.Text); 4820Assert.Equal(AzureProvisioningController.CancelingState, storageEvent.Snapshot.State?.Text); 4826Assert.Equal(AzureProvisioningStrings.ResourceStateCanceled, storageEvent.Snapshot.State?.Text); 4827Assert.Equal(KnownResourceStateStyles.Info, storageEvent.Snapshot.State?.Style); 4850Assert.Equal("Failed to Provision", environmentEvent.Snapshot.State?.Text); 5168resourceEvent.Snapshot.State?.Text == expectedState) 5184? finalEvent.Snapshot.State?.Text
Aspire.Hosting.Blazor (3)
BlazorGatewayExtensions.cs (1)
520var 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)
964resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1013resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1034resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1098resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1111resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1173resourceEvent.Snapshot.State?.Text == KnownResourceStates.FailedToStart && 1226resourceEvent.Snapshot.State?.Text == KnownResourceStates.FailedToStart && 1235resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1286resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1410resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1446resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1478resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1494resourceEvent.Snapshot.State?.Text == KnownResourceStates.Finished && 1500Assert.Equal(KnownResourceStates.Finished, allCompletedEvent.Snapshot.State?.Text); 1547resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running && 1563resourceEvent.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 (6)
DevTunnelMonitor.cs (2)
437&& KnownResourceStates.TerminalStates.Contains(update.Snapshot.State?.Text)) 702|| !KnownResourceStates.TerminalStates.Contains(current.Snapshot.State?.Text));
DevTunnelResourceBuilderExtensions.cs (4)
649context.ResourceSnapshot.State?.Text == KnownResourceStates.Running && 741&& previous.Snapshot.State?.Text == KnownResourceStates.Running 747StartTimeStamp = snapshot.State?.Text == KnownResourceStates.Running ? snapshot.StartTimeStamp : DateTime.UtcNow, 824&& KnownResourceStates.TerminalStates.Contains(current.Snapshot.State?.Text))
Aspire.Hosting.DevTunnels.Tests (9)
DevTunnelMonitorTests.cs (6)
23Assert.Equal(KnownResourceStates.Running, test.Snapshot(test.Port).State?.Text); 66Assert.Equal(KnownResourceStates.NotStarted, test.Snapshot(test.Port).State?.Text); 441Assert.Equal(KnownResourceStates.Finished, test.Snapshot(test.Port).State?.Text); 469Assert.Equal(KnownResourceStates.Finished, test.Snapshot(test.Port).State?.Text); 553Assert.Equal(KnownResourceStates.Finished, test.Snapshot(test.Port).State?.Text); 707Assert.Equal(KnownResourceStates.Finished, test.Snapshot(test.Port).State?.Text);
DevTunnelResourceBuilderExtensionsTests.cs (2)
783Assert.Equal(restartBeforeUrlCallbackCompletes ? KnownResourceStates.Running : KnownResourceStates.Finished, completed.Snapshot.State?.Text); 803e => e.Snapshot.State?.Text == KnownResourceStates.Running &&
TestDevTunnelMonitor.cs (1)
88e => e.Snapshot.State?.Text == KnownResourceStates.Running && e.Snapshot.HealthStatus == Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus.Healthy).DefaultTimeout();
Aspire.Hosting.Dotnet (6)
DotnetProjectBuildCoordinator.cs (6)
192if (buildEvent.Snapshot.State?.Text == KnownResourceStates.FailedToStart || 202snapshot.State?.Text == KnownResourceStates.FailedToStart || 203(KnownResourceStates.TerminalStates.Contains(snapshot.State?.Text) && 305rebuildEvent.Snapshot.State?.Text is { } state && 1262(resourceEvent.Snapshot.State?.Text == KnownResourceStates.FailedToStart || 1263KnownResourceStates.TerminalStates.Contains(resourceEvent.Snapshot.State?.Text)),
Aspire.Hosting.Dotnet.Tests (13)
DotnetProjectBuildCoordinatorTests.cs (13)
589resourceEvent.Snapshot.State?.Text == KnownResourceStates.Finished && 595resourceEvent.Snapshot.State?.Text == KnownResourceStates.Finished && 2801resourceEvent => resourceEvent.ResourceId == name && resourceEvent.Snapshot.State?.Text == KnownResourceStates.Finished, 2843resourceEvent => resourceEvent.ResourceId == name && resourceEvent.Snapshot.State?.Text == KnownResourceStates.FailedToStart, 2950Assert.Equal(KnownResourceStates.Finished, firstBuildEvent.Snapshot.State?.Text); 2952Assert.Equal(KnownResourceStates.FailedToStart, secondBuildEvent.Snapshot.State?.Text); 3173Assert.Equal(KnownResourceStates.NotStarted, projectEvent.Snapshot.State?.Text); 3586KnownResourceStates.TerminalStates.Contains(resourceEvent.Snapshot.State?.Text) && 3641resourceEvent => resourceEvent.Snapshot.State?.Text == KnownResourceStates.Starting, 3662resourceEvent => resourceEvent.Snapshot.State?.Text == KnownResourceStates.Starting, 3685Assert.Equal(KnownResourceStates.Finished, buildEvent.Snapshot.State?.Text); 3693resourceEvent => resourceEvent.Snapshot.State?.Text == KnownResourceStates.FailedToStart, 3695Assert.Equal(KnownResourceStates.FailedToStart, workerEvent.Snapshot.State?.Text);
Aspire.Hosting.EntityFrameworkCore (4)
EFCoreOperationExecutor.cs (4)
335r => r.Snapshot.State?.Text == KnownResourceStates.Finished || 336r.Snapshot.State?.Text == KnownResourceStates.Exited || 337r.Snapshot.State?.Text == KnownResourceStates.FailedToStart, 368if ((exitCode != null && exitCode.Value != 0) || snapshot.State?.Text == KnownResourceStates.FailedToStart)
Aspire.Hosting.EntityFrameworkCore.Tests (2)
AddEFMigrationsTests.cs (1)
241Assert.Equal("NotStarted", snapshotAnnotation.InitialSnapshot.State?.Text);
EFBuildReadinessTests.cs (1)
49Assert.Equal(KnownResourceStates.Finished, state.Snapshot.State?.Text);
Aspire.Hosting.Maui (8)
Lifecycle\MauiBuildQueueEventSubscriber.cs (6)
334e => ShouldReleaseBuildLockForLaunchState(e.Snapshot.State?.Text, stateAtCallTime, releaseOnRunning), 405e => ShouldReleaseBuildLockForLaunchState(e.Snapshot.State?.Text, stateAtCallTime, releaseOnRunning: false), 525var state = context.ResourceSnapshot.State?.Text; 560e => string.Equals(e.Snapshot.State?.Text, KnownResourceStates.FailedToStart, StringComparisons.ResourceState), 580if (s.State?.Text is not null && 581!string.Equals(s.State.Text, KnownResourceStates.FailedToStart, StringComparisons.ResourceState))
MauiOtlpExtensions.cs (2)
430IsUnavailableState(resourceEvent.Snapshot.State?.Text), 447if (IsUnavailableState(resourceEvent.Snapshot.State?.Text) ||
Aspire.Hosting.Maui.Tests (3)
MauiBuildQueueTests.cs (3)
131if (evt.Resource.Name == env.MacCatalyst.Name && evt.Snapshot.State?.Text == "Queued") 165if (evt.Resource.Name == env.Android.Name && evt.Snapshot.State?.Text == "Building") 1165if (evt.Resource.Name == resource.Name && evt.Snapshot.State?.Text == state)
Aspire.Hosting.MongoDB (3)
MongoDBSingleMemberReplicaSet.cs (1)
47var isRunning = update.Snapshot.State?.Text == KnownResourceStates.Running;
src\Shared\ContainerReplCommand.cs (2)
29resourceEvent.Snapshot.State?.Text != KnownResourceStates.Running) 60UpdateState = context => context.ResourceSnapshot.State?.Text == KnownResourceStates.Running &&
Aspire.Hosting.MongoDB.Tests (2)
ReplicaSet\AddMongoDBReplicaSetTests.cs (1)
369return resourceEvent.Snapshot.State?.Text;
SingleMemberReplicaSetFunctionalTests.cs (1)
167update => update.Snapshot.State?.Text == KnownResourceStates.Exited, ready.Token);
Aspire.Hosting.MySql (2)
src\Shared\ContainerReplCommand.cs (2)
29resourceEvent.Snapshot.State?.Text != KnownResourceStates.Running) 60UpdateState = context => context.ResourceSnapshot.State?.Text == KnownResourceStates.Running &&
Aspire.Hosting.PostgreSQL (2)
src\Shared\ContainerReplCommand.cs (2)
29resourceEvent.Snapshot.State?.Text != KnownResourceStates.Running) 60UpdateState = context => context.ResourceSnapshot.State?.Text == KnownResourceStates.Running &&
Aspire.Hosting.Redis (2)
src\Shared\ContainerReplCommand.cs (2)
29resourceEvent.Snapshot.State?.Text != KnownResourceStates.Running) 60UpdateState = context => context.ResourceSnapshot.State?.Text == KnownResourceStates.Running &&
Aspire.Hosting.Redis.Tests (3)
RedisFunctionalTests.cs (3)
122e => e.Snapshot.State == KnownResourceStates.Running, 168e => e.Snapshot.State == KnownResourceStates.Running, 180e => e.Snapshot.State == KnownResourceStates.Running,
Aspire.Hosting.SqlServer (2)
src\Shared\ContainerReplCommand.cs (2)
29resourceEvent.Snapshot.State?.Text != KnownResourceStates.Running) 60UpdateState = context => context.ResourceSnapshot.State?.Text == KnownResourceStates.Running &&
Aspire.Hosting.Testing.Tests (2)
DashboardUrlTests.cs (2)
107resourceEvent => resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running, 135resourceEvent => resourceEvent.Snapshot.State?.Text == updatedState,
Aspire.Hosting.Tests (121)
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); 298await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Finished, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 302await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 353await rns.WaitForResourceAsync(normalResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); 356await rns.WaitForResourceAsync(explicitStartResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, token).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); 396var notStartedResourceEvent = await rns.WaitForResourceAsync(explicitStartResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 405await rns.WaitForResourceAsync(explicitStartResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); 550e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, 555e => e.Snapshot.State?.Text == KnownResourceStates.Waiting, 577var runningResourceEvent = await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 584var dependentRunningResourceEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 593await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Exited, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 597await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 639notStartedResourceEvent = await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 640dependentResourceEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Waiting, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 662var runningResourceEvent = await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 669var dependentRunningResourceEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 678await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Exited, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 685await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 1110var dependentRunningResourceEvent = await rns.WaitForResourceAsync(container.Resource.Name, e => e.Snapshot.State?.Text == KnownResourceStates.Running).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 2122var state = e.Snapshot.State?.Text; 2131var state = e.Snapshot.State?.Text; 2167e => e.Snapshot.State?.Text == KnownResourceStates.Running && 2172e => 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 (25)
39Assert.Equal(KnownResourceStates.Finished, @event.ResourceEvent.Snapshot.State?.Text); 69snapshot => snapshot with { State = state is not null ? new(state, null) : snapshot.State, ExitCode = state == KnownResourceStates.Finished ? 0 : null })); 564Assert.Equal(KnownResourceStates.FailedToStart, snapshotEvent.Snapshot.State?.Text); 565Assert.Equal(KnownResourceStateStyles.Error, snapshotEvent.Snapshot.State?.Style); 592Assert.Equal(KnownResourceStates.FailedToStart, snapshotEvent.Snapshot.State?.Text); 593Assert.Null(snapshotEvent.Snapshot.State?.Style); 616Assert.Equal(KnownResourceStates.Starting, snapshotEvent.Snapshot.State?.Text); 648Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 689Assert.NotEqual(KnownResourceStates.Running, dependencyEvent.Snapshot.State?.Text); 737e => e.ResourceId == "waiter-abc123" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 795e => e.ResourceId == "waiter-abc123" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 799Assert.Equal(KnownResourceStates.NotStarted, siblingEvent.Snapshot.State?.Text); 846e => e.ResourceId == "waiter-abc123" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 900e => e.ResourceId == "waiter-abc123" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 908e => e.ResourceId == "waiter-def456" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 962Assert.NotEqual(KnownResourceStates.Running, blockerEvent.Snapshot.State?.Text); 1011|| waiterEvent.Snapshot.State?.Text != KnownResourceStates.Waiting) 1028Assert.NotEqual(KnownResourceStates.Running, blockerEvent.Snapshot.State?.Text); 1095re => re.Snapshot.State?.Text == KnownResourceStates.Waiting, 1363var parentState = resourceNotificationService.TryGetCurrentState("parent-container-dcp", out var parentEvent) ? parentEvent.Snapshot.State?.Text : null; 1364var childContainerState = resourceNotificationService.TryGetCurrentState(childContainer.Resource.Name, out var childContainerEvent) ? childContainerEvent.Snapshot.State?.Text : null; 1365var customChildState = resourceNotificationService.TryGetCurrentState(customChild.Resource.Name, out var customChildEvent) ? customChildEvent.Snapshot.State?.Text : null; 1411var parentState = resourceNotificationService.TryGetCurrentState("parent-container-dcp", out var parentEvent) ? parentEvent.Snapshot.State?.Text : null; 1412var childProjectState = resourceNotificationService.TryGetCurrentState(childProject.Resource.Name, out var childProjectEvent) ? childProjectEvent.Snapshot.State?.Text : null; 1413var customChildState = resourceNotificationService.TryGetCurrentState(customChild.Resource.Name, out var customChildEvent) ? customChildEvent.Snapshot.State?.Text : null;
Orchestrator\ParameterProcessorTests.cs (4)
103Assert.Equal(KnownResourceStates.Running, snapshot.State?.Text); 261Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 265Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 269Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text);
ResourceCommandServiceTests.cs (1)
1753await resourceNotificationService.WaitForResourceAsync(project.Resource.Name, e => KnownResourceStates.BuildableStates.Contains(e.Snapshot.State?.Text), cts.Token).DefaultTimeout(TimeSpan.FromMinutes(2));
ResourceNotificationTests.cs (29)
419re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 423Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 432re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 467re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 471Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 485re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 523re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 527Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 537re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 577re => re.Snapshot.State?.Text == KnownResourceStates.Waiting, 580Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 623Assert.Equal(state, resourceEvent.Snapshot.State?.Text); 657re => re.ResourceId == "resource-abc123" && re.Snapshot.State?.Text == KnownResourceStates.Waiting, 661Assert.Equal(KnownResourceStates.NotStarted, notStartedEvent.Snapshot.State?.Text); 671Assert.Equal(KnownResourceStates.NotStarted, notStartedEvent.Snapshot.State?.Text); 701Assert.Equal(KnownResourceStates.NotStarted, notStartedEvent.Snapshot.State?.Text); 728re => re.Snapshot.State?.Text == KnownResourceStates.Waiting, 767re => re.ResourceId == "resource-abc123" && re.Snapshot.State?.Text == KnownResourceStates.Waiting, 799re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 812re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 903re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 1130Assert.Equal("Running", secondEvent.Snapshot.State?.Text); 1167Assert.Equal("Starting", value.Snapshot.State?.Text); 1203Assert.Equal("Starting", value.Snapshot.State?.Text); 1460return resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running; 1470Assert.Equal(KnownResourceStates.Running, (await waitTask.DefaultTimeout()).Snapshot.State?.Text); 1503return resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running; 1507Assert.Equal(KnownResourceStates.Running, (await waitTask).Snapshot.State?.Text); 1762Assert.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 (8)
467e => e.Snapshot.State == KnownResourceStates.Running 503testOutputHelper.WriteLine($"Captured snapshot #{urlSnapshots.Count}: State={notification.Snapshot.State}, URLs: {FormatUrls(notification.Snapshot.Urls)}"); 506if (notification.Snapshot.State == KnownResourceStates.Running && 619testOutputHelper.WriteLine($"Captured snapshot #{urlSnapshots.Count}: State={notification.Snapshot.State}, URLs: {FormatUrls(notification.Snapshot.Urls)}"); 622if (notification.Snapshot.State == KnownResourceStates.Running && 693e => e.Snapshot.State == KnownResourceStates.Running && e.Snapshot.Urls.Length == 4).DefaultTimeout(); 1082e => e.Snapshot.State == KnownResourceStates.Running 1134e => e.Snapshot.State == KnownResourceStates.Running,
Aspire.Hosting.Valkey (2)
src\Shared\ContainerReplCommand.cs (2)
29resourceEvent.Snapshot.State?.Text != KnownResourceStates.Running) 60UpdateState = context => context.ResourceSnapshot.State?.Text == 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)));