524 writes to State
Aspire.Hosting (33)
ApplicationModel\CertificateAuthorityCollectionResourceExtensions.cs (1)
36State = KnownResourceStates.Active
ApplicationModel\CommandsConfigurationExtensions.cs (7)
246: s with { State = new ResourceStateSnapshot(KnownResourceStates.Building, KnownResourceStateStyles.Info) }; 292State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error) 306State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error) 332State = new ResourceStateSnapshot(KnownResourceStates.Starting, KnownResourceStateStyles.Info) 359State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error) 371State = new ResourceStateSnapshot(KnownResourceStates.Finished, KnownResourceStateStyles.Info) 422? snapshot with { State = new ResourceStateSnapshot(restoredState, KnownResourceStateStyles.Info) }
ApplicationModel\ResourceNotificationService.cs (1)
664State = KnownResourceStates.Waiting,
Ats\NotificationExports.cs (1)
103snapshot = snapshot with { State = new ResourceStateSnapshot(state, stateStyle) };
ConnectionStringBuilderExtensions.cs (3)
84State = KnownResourceStates.NotStarted, 98State = KnownResourceStates.Running 112State = KnownResourceStates.FailedToStart
Dcp\DcpExecutor.cs (2)
922State = new ResourceStateSnapshot(KnownResourceStates.NotStarted, null) 943State = new ResourceStateSnapshot(KnownResourceStates.NotStarted, null)
Dcp\ResourceSnapshotBuilder.cs (4)
53State = state, 118State = state, 199State = state, 224State = state,
ExternalServiceBuilderExtensions.cs (4)
109State = KnownResourceStates.Waiting, 147State = KnownResourceStates.FailedToStart 159State = KnownResourceStates.FailedToStart 176State = KnownResourceStates.Running
Orchestrator\ApplicationOrchestrator.cs (6)
260State = KnownResourceStates.Starting, 273State = KnownResourceStates.Starting, 678await _notificationService.PublishUpdateAsync(context.Resource, context.DcpResourceName, s => s with { State = stateSnapshot }).ConfigureAwait(false); 687await _notificationService.PublishUpdateAsync(context.Resource, s => s with { State = stateSnapshot }).ConfigureAwait(false); 726return s with { State = KnownResourceStates.Starting }; 758State = state,
Orchestrator\ParameterProcessor.cs (1)
1002State = state
ParameterResourceBuilderExtensions.cs (1)
337State = KnownResourceStates.Waiting
ProjectResourceBuilderExtensions.cs (1)
1178State = KnownResourceStates.NotStarted,
TerminalResourceBuilderExtensions.cs (1)
354State = KnownResourceStates.NotStarted,
Aspire.Hosting.Azure (29)
AzureEnvironmentResourceExtensions.cs (1)
45State = KnownResourceStates.NotStarted,
AzureProvisioningController.cs (18)
1103State = new(StartingState, KnownResourceStateStyles.Info), 1246State = KnownResourceStates.NotStarted, 2007State = new(ChangingLocationState, KnownResourceStateStyles.Info) 2154State = new(CancelingState, KnownResourceStateStyles.Info) 2171State = new(AzureProvisioningStrings.ResourceStateCanceled, KnownResourceStateStyles.Info) 2196State = new(DeletingState, KnownResourceStateStyles.Info) 2228State = new(AzureProvisioningStrings.ResourceStateCanceled, KnownResourceStateStyles.Info) 2240State = new(AzureProvisioningStrings.ResourceStateFailedToDelete, KnownResourceStateStyles.Error) 2297State = new(MissingInAzureState, KnownResourceStateStyles.Error) 3860State = new(KnownResourceStates.Running, KnownResourceStateStyles.Success) 3868State = new(AzureProvisioningStrings.ResourceStateMissingSubscriptionConfiguration, KnownResourceStateStyles.Error) 3875State = new(AzureProvisioningStrings.ResourceStateCanceled, KnownResourceStateStyles.Info) 3888State = new(AzureProvisioningStrings.ResourceStateFailedToProvision, KnownResourceStateStyles.Error), 3909State = new(AzureProvisioningStrings.ResourceStateFailedToProvision, KnownResourceStateStyles.Error), 3932State = publishedTerminalState 3957State = new(AzureProvisioningStrings.ResourceStateCanceled, KnownResourceStateStyles.Info) 4006State = new("Failed to Provision Roles", KnownResourceStateStyles.Error) 4309State = state,
Provisioning\Provisioners\BicepProvisioner.cs (10)
144State = new(AzureProvisioningController.ProvisionedState, KnownResourceStateStyles.Success), 332State = new(AzureProvisioningController.WaitingForDeploymentState, KnownResourceStateStyles.Info), 446State = new(state, KnownResourceStateStyles.Error) 533State = new(AzureProvisioningController.StartingState, KnownResourceStateStyles.Info), 556State = new(AzureProvisioningController.CompilingArmTemplateState, KnownResourceStateStyles.Info) 590State = new(AzureProvisioningController.CreatingArmDeploymentState, KnownResourceStateStyles.Info), 661State = new(AzureProvisioningStrings.ResourceStateAzureDeploymentFailed, KnownResourceStateStyles.Error), 694State = new(AzureProvisioningController.WaitingForDeploymentState, KnownResourceStateStyles.Info), 835State = new(AzureProvisioningController.ProvisionedState, KnownResourceStateStyles.Success), 999State = CreateDeploymentOperationState(summary),
Aspire.Hosting.Azure.EntraId (3)
EntraIdResourceExtensions.cs (3)
87State = KnownResourceStates.Waiting, 261State = KnownResourceStates.Running 316State = KnownResourceStates.FailedToStart
Aspire.Hosting.Azure.EntraId.Tests (4)
EntraIdInitializationTests.cs (4)
248await notifications.PublishUpdateAsync(entra.Resource, snapshot => snapshot with { State = new("Missing subscription configuration", KnownResourceStateStyles.Error) }); 283await notifications.PublishUpdateAsync(entra.Resource, snapshot => snapshot with { State = KnownResourceStates.Waiting }); 287await notifications.PublishUpdateAsync(entra.Resource, snapshot => snapshot with { State = KnownResourceStates.Running }); 332await notifications.PublishUpdateAsync(entra.Resource, snapshot => snapshot with { State = KnownResourceStates.Waiting });
Aspire.Hosting.Azure.Functions (1)
DurableTask\DurableTaskResourceExtensions.cs (1)
242State = KnownResourceStates.Running,
Aspire.Hosting.Azure.Kusto (1)
AzureKustoBuilderExtensions.cs (1)
317State = KnownResourceStates.FailedToStart
Aspire.Hosting.Azure.Tests (60)
AzureEnvironmentResourceExtensionsTests.cs (60)
101State = KnownResourceStates.Running, 628State = KnownResourceStates.Running, 637State = KnownResourceStates.Running, 1049await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = KnownResourceStates.Running }); 1084await notifications.PublishUpdateAsync(postgres.Resource, state => state with { State = KnownResourceStates.Running }); 1707await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new("Waiting for Deployment", KnownResourceStateStyles.Info) }); 1762await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new("Creating ARM Deployment", KnownResourceStateStyles.Info) }); 1839await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new(AzureProvisioningController.WaitingForDeploymentState, KnownResourceStateStyles.Info) }); 2009await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2047await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2130await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new("Failed to Provision", KnownResourceStateStyles.Error) }); 2131await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2225await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = new("Failed to Provision", KnownResourceStateStyles.Error) }); 2294await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 2295await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2296await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2373await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2443State = KnownResourceStates.Running, 2450State = KnownResourceStates.Running, 2516await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2517await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2569await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 2570await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 2571await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 2630await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 2631await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3047await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 3048await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3049await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 3121await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = new("Failed to Provision", KnownResourceStateStyles.Error) }); 3122await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 3175await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3235await notifications.PublishUpdateAsync(visibleResource, state => state with { State = KnownResourceStates.Running }); 3290await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3365State = KnownResourceStates.Running, 3425State = KnownResourceStates.Running, 3496await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3551State = KnownResourceStates.Running, 3614State = KnownResourceStates.Running, 3686State = KnownResourceStates.Running, 3741await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 3742await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 3958State = KnownResourceStates.Running, 4101State = KnownResourceStates.Running, 4186await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4258await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = new("Canceled", KnownResourceStateStyles.Info) }); 4338await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = new("Canceled", KnownResourceStateStyles.Info) }); 4412await notifications.PublishUpdateAsync(postgres.Resource, state => state with { State = KnownResourceStates.Running }); 4464await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4510await notifications.PublishUpdateAsync(keyVault.Resource, state => state with { State = KnownResourceStates.Running }); 4556await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4670await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 4671await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4723await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 4724await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4781await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 4782await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running }); 4783await notifications.PublishUpdateAsync(storage2.Resource, state => state with { State = KnownResourceStates.Running }); 4825await notifications.PublishUpdateAsync(environmentResource, state => state with { State = KnownResourceStates.Running }); 4826await notifications.PublishUpdateAsync(storage.Resource, state => state with { State = KnownResourceStates.Running });
Aspire.Hosting.Blazor (3)
BlazorGatewayExtensions.cs (3)
199State = KnownResourceStates.Waiting, 224State = KnownResourceStates.Waiting, 535State = gatewayState,
Aspire.Hosting.Blazor.Tests (8)
BlazorHostedExtensionsTests.cs (1)
608State = 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)
257State = resourceState 298State = 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, 753State = KnownResourceStates.Running, 841State = KnownResourceStates.Finished,
Aspire.Hosting.DevTunnels.Tests (5)
DevTunnelMonitorTests.cs (1)
539await test.App.ResourceNotifications.PublishUpdateAsync(test.Tunnel, s => s with { State = KnownResourceStates.FailedToStart });
DevTunnelResourceBuilderExtensionsTests.cs (3)
582State = KnownResourceStates.Running 592State = KnownResourceStates.Finished 603State = KnownResourceStates.Running
TestDevTunnelMonitor.cs (1)
61await App.ResourceNotifications.PublishUpdateAsync(Tunnel, s => s with { State = KnownResourceStates.Running });
Aspire.Hosting.Dotnet.Tests (43)
DotnetProjectBuildCoordinatorTests.cs (43)
236State = KnownResourceStates.Finished, 253State = KnownResourceStates.Finished, 730State = KnownResourceStates.Finished, 1717State = KnownResourceStates.Finished, 1768State = KnownResourceStates.Finished, 1808State = KnownResourceStates.Finished, 1845State = KnownResourceStates.Finished, 1895State = KnownResourceStates.Finished, 1905State = KnownResourceStates.Starting, 1919State = KnownResourceStates.Finished, 2015snapshot => snapshot with { State = KnownResourceStates.Running }); 2022State = KnownResourceStates.Finished, 2056snapshot => snapshot with { State = KnownResourceStates.Finished, ExitCode = 0 }); 2066snapshot => snapshot with { State = KnownResourceStates.Starting, ExitCode = null }); 2075snapshot => snapshot with { State = finalState, ExitCode = exitCode }); 2121snapshot => snapshot with { State = KnownResourceStates.Finished, ExitCode = 1 }); 2178snapshot => snapshot with { State = KnownResourceStates.Finished, ExitCode = 1 }); 2186snapshot => snapshot with { State = KnownResourceStates.Starting, ExitCode = null }); 2193snapshot => snapshot with { State = KnownResourceStates.Finished, ExitCode = 1 }); 2280State = KnownResourceStates.Finished, 2420State = KnownResourceStates.Finished, 2679State = KnownResourceStates.Finished, 2779State = KnownResourceStates.Finished, 2794State = KnownResourceStates.Finished, 2909State = KnownResourceStates.Finished, 3040State = KnownResourceStates.Finished, 3082State = KnownResourceStates.Finished, 3692State = state, 4281State = KnownResourceStates.Finished, 4286State = KnownResourceStates.Finished, 4379State = KnownResourceStates.Finished, 4387State = finalState, 4394State = KnownResourceStates.Running, 4401State = KnownResourceStates.Finished, 4437State = KnownResourceStates.Finished, 4459State = KnownResourceStates.Finished, 4464State = KnownResourceStates.NotStarted 4472State = KnownResourceStates.Running, 4479State = KnownResourceStates.Exited, 4521State = KnownResourceStates.Finished, 4556State = KnownResourceStates.Finished, 4582State = KnownResourceStates.Finished, 4738snapshot => snapshot with { State = KnownResourceStates.Waiting });
Aspire.Hosting.EntityFrameworkCore (9)
EFResourceBuilderExtensions.cs (9)
276State = new ResourceStateSnapshot(KnownResourceStates.NotStarted, KnownResourceStateStyles.Info) 518State = KnownResourceStates.FailedToStart 554State = KnownResourceStates.Starting, 566State = KnownResourceStates.FailedToStart 578State = KnownResourceStates.Running 596State = finalState, 633State = KnownResourceStates.FailedToStart, 658State = KnownResourceStates.FailedToStart, 982State = new ResourceStateSnapshot(state, style)
Aspire.Hosting.EntityFrameworkCore.Tests (6)
EFMigrationCommandsTests.cs (4)
204State = new ResourceStateSnapshot(KnownResourceStates.Finished, KnownResourceStateStyles.Info) 234State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Info) 264State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Info) 284State = new ResourceStateSnapshot(KnownResourceStates.Finished, KnownResourceStateStyles.Info)
TestServices\CoordinatedBuildTestHelpers.cs (1)
25State = KnownResourceStates.Finished,
TestServices\TestEfTool.cs (1)
45State = 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 592State = 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)
605State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error) 672State = new ResourceStateSnapshot("Building", KnownResourceStateStyles.Info) 693State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success) 742State = new ResourceStateSnapshot("Building", KnownResourceStateStyles.Info) 760State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success) 768State = new ResourceStateSnapshot("Terminated", KnownResourceStateStyles.Success) 940State = new ResourceStateSnapshot("Terminated", KnownResourceStateStyles.Success) 1165State = state
MauiPlatformExtensionsTests.cs (4)
924State = KnownResourceStates.Running, 1221State = KnownResourceStates.Running 1332State = KnownResourceStates.Running 1348State = dashboardState
Aspire.Hosting.MongoDB (8)
ReplicaSet\MongoDBReplicaSetBuilderExtensions.cs (8)
102State = KnownResourceStates.Waiting, 120State = KnownResourceStates.FailedToStart, 138State = KnownResourceStates.Starting, 342State = KnownResourceStates.Running, 350State = KnownResourceStates.FailedToStart, 478? s with { State = KnownResourceStates.Exited } 500? s with { State = KnownResourceStates.Starting } 517? 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)
60State = state is null ? null : new ResourceStateSnapshot(state, null), 79State = state,
Aspire.Hosting.MySql.Tests (2)
tests\Shared\ContainerReplCommandTestBase.cs (2)
60State = state is null ? null : new ResourceStateSnapshot(state, null), 79State = state,
Aspire.Hosting.OpenAI (4)
OpenAIExtensions.cs (4)
70State = KnownResourceStates.Waiting, 86State = KnownResourceStates.Running, 119State = KnownResourceStates.Waiting, 132State = KnownResourceStates.Running,
Aspire.Hosting.PostgreSQL.Tests (3)
PostgresReplCommandTests.cs (1)
95await app.ResourceNotifications.PublishUpdateAsync(postgres.Resource, s => s with { State = KnownResourceStates.FailedToStart });
tests\Shared\ContainerReplCommandTestBase.cs (2)
60State = state is null ? null : new ResourceStateSnapshot(state, null), 79State = state,
Aspire.Hosting.Redis.Tests (2)
tests\Shared\ContainerReplCommandTestBase.cs (2)
60State = state is null ? null : new ResourceStateSnapshot(state, null), 79State = state,
Aspire.Hosting.SqlServer.Tests (2)
tests\Shared\ContainerReplCommandTestBase.cs (2)
60State = state is null ? null : new ResourceStateSnapshot(state, null), 79State = state,
Aspire.Hosting.Testing.Tests (4)
DashboardUrlTests.cs (2)
112snapshot => snapshot with { State = initialState }); 139snapshot => 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 (183)
Backchannel\AppHostBackchannelTests.cs (1)
81State = new ("Running", null),
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (27)
136State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success) 140State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success) 185State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 353State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 452State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 501State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 563State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 592State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 639State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 666State = new ResourceStateSnapshot("Stopping", KnownResourceStateStyles.Info), 709State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 737State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 780State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 805State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 869State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success) 873State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 929State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 1082State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 1145State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 1161State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 1198State = new ResourceStateSnapshot("Running", KnownResourceStateStyles.Success), 1270State = new ResourceStateSnapshot("Failed to Provision Roles", KnownResourceStateStyles.Error) 1405State = new ResourceStateSnapshot("Running", null) 1441State = new ResourceStateSnapshot("Running", null) 1487State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success) 1526State = new ResourceStateSnapshot(KnownResourceStates.Running, KnownResourceStateStyles.Success) 2218State = KnownResourceStates.Running,
Codespaces\CodespacesUrlRewriterTests.cs (1)
97State = KnownResourceStates.Running,
Dashboard\DashboardResourceTests.cs (1)
752await resourceNotificationService.PublishUpdateAsync(dashboard, "aspire-dashboard-0", s => s with { State = "Running" }).DefaultTimeout();
Dashboard\DashboardServiceDataTerminalTests.cs (6)
37await notifications.PublishUpdateAsync(resource, s => s with { State = new ResourceStateSnapshot("Running", null) }).DefaultTimeout(); 52await notifications.PublishUpdateAsync(resource, s => s with { State = new ResourceStateSnapshot("Running", null) }).DefaultTimeout(); 67await notifications.PublishUpdateAsync(resource, s => s with { State = new ResourceStateSnapshot("Running", null) }).DefaultTimeout(); 107await notifications.PublishUpdateAsync(resource, "myapp-ccc", s => s with { State = new ResourceStateSnapshot("Running", null) }).DefaultTimeout(); 130await notifications.PublishUpdateAsync(resource, s => s with { State = new ResourceStateSnapshot("Running", null) }).DefaultTimeout(); 155await 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 (23)
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) 670State = 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)
547snapshot => snapshot with { State = snapshotState }); 574snapshot => snapshot with { State = state is not null ? new(state, null) : snapshot.State, ExitCode = state == KnownResourceStates.Finished ? 0 : null })); 1234State = KnownResourceStates.Running 1249State = KnownResourceStates.Building 1462await resourceNotificationService.PublishUpdateAsync(waiter.Resource, s => s with { State = KnownResourceStates.Starting }).DefaultTimeout(); 1522await resourceNotificationService.PublishUpdateAsync(waiter.Resource, s => s with { State = KnownResourceStates.Starting }); 1624await notificationService.PublishUpdateAsync(resource, instance.Name, s => s with { State = state }).DefaultTimeout(); 1639State = KnownResourceStates.NotStarted, 1657State = KnownResourceStates.Running, 1866snapshot => snapshot with { State = KnownResourceStates.FailedToStart })); 1914snapshot => snapshot with { State = KnownResourceStates.FailedToStart }));
ResourceCommandAnnotationTests.cs (4)
71State = resourceState 151State = resourceState 228State = new ResourceStateSnapshot(state, null), 291State = new ResourceStateSnapshot(currentState, null),
ResourceNotificationTests.cs (70)
265(snapshot with { State = KnownResourceStates.Running }).WithHealthReports( 352await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 368await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 383await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 398await notificationService.PublishUpdateAsync(resource, snapshot => snapshot with { State = "SomeOtherState" }).DefaultTimeout(); 420await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = KnownResourceStates.Running }).DefaultTimeout(); 442await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeOtherState" }).DefaultTimeout(); 468await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeOtherState" }).DefaultTimeout(); 485await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 538State = KnownResourceStates.Running 551State = KnownResourceStates.Running 575State = KnownResourceStates.Running, 602State = KnownResourceStates.Running, 607State = KnownResourceStates.Running, 643State = KnownResourceStates.Running, 661State = KnownResourceStates.Running, 698State = KnownResourceStates.Finished, 712State = KnownResourceStates.Finished, 736State = KnownResourceStates.NotStarted 752State = KnownResourceStates.Running 777await notificationService.PublishUpdateAsync(resource, s => s with { State = state }).DefaultTimeout(); 784State = KnownResourceStates.Running 812State = KnownResourceStates.Starting 816State = KnownResourceStates.NotStarted 832State = KnownResourceStates.Running 854State = KnownResourceStates.NotStarted 862State = KnownResourceStates.Running 887State = KnownResourceStates.NotStarted 902State = KnownResourceStates.Running 926State = KnownResourceStates.NotStarted 941State = KnownResourceStates.Running 974State = KnownResourceStates.Running 987State = KnownResourceStates.Running 1004State = KnownResourceStates.Waiting, 1013State = KnownResourceStates.Running 1029State = KnownResourceStates.Running 1034State = KnownResourceStates.Waiting, 1062State = KnownResourceStates.Starting 1125await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 1136await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 1146await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "NewState" }).DefaultTimeout(); 1156await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = null }).DefaultTimeout(); 1166await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "" }).DefaultTimeout(); 1176await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = " " }).DefaultTimeout(); 1195await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 1281State = "Running" // Change something else to trigger an update 1326State = "Starting" 1362State = "Starting" 1493State = KnownResourceStates.Running 1499State = KnownResourceStates.Running, 1538State = KnownResourceStates.Running, 1563State = KnownResourceStates.Running 1571State = KnownResourceStates.Running, 1597State = KnownResourceStates.Running, 1620State = KnownResourceStates.Starting 1634State = KnownResourceStates.Running 1660State = KnownResourceStates.Running 1708State = KnownResourceStates.Running 1726State = KnownResourceStates.Running 1748State = KnownResourceStates.Running 1769State = KnownResourceStates.Running, 1787State = KnownResourceStates.Running, 1804State = KnownResourceStates.Running, 1820State = KnownResourceStates.Running, 1825State = KnownResourceStates.FailedToStart 1872await notificationService.PublishUpdateAsync(resourceBuilder.Resource, snapshot => snapshot with { State = state, ExitCode = exitCode }).DefaultTimeout(); 1916await notificationService.PublishUpdateAsync(resource, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 1920await notificationService.PublishUpdateAsync(resource, snapshot => snapshot with { State = "SomeState" }).DefaultTimeout(); 1925await notificationService.PublishUpdateAsync(resource, snapshot => snapshot with { State = "SomeOtherState" }).DefaultTimeout(); 1948State = "SomeState",
WaitForTests.cs (21)
113State = KnownResourceStates.Running 144State = KnownResourceStates.Running 184State = KnownResourceStates.Running 222State = status 333State = status 367State = status 375State = KnownResourceStates.Running 414State = status 422State = KnownResourceStates.Running 462State = KnownResourceStates.Finished, 509State = KnownResourceStates.Finished, 564State = KnownResourceStates.Running 618State = KnownResourceStates.Finished, 667State = KnownResourceStates.Running, 675State = KnownResourceStates.Running, 720State = KnownResourceStates.Finished, 728State = KnownResourceStates.Finished, 769State = KnownResourceStates.Finished 833State = KnownResourceStates.Running, 881State = KnownResourceStates.Running, 975State = 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)
72State = KnownResourceStates.NotStarted, 104State = KnownResourceStates.Running
Aspire.Hosting.Valkey.Tests (2)
tests\Shared\ContainerReplCommandTestBase.cs (2)
60State = state is null ? null : new ResourceStateSnapshot(state, null), 79State = 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
404 references to State
Aspire.Hosting (80)
ApplicationModel\CommandsConfigurationExtensions.cs (10)
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; 243postStopStates[name] = s.State?.Text; 244return s.State?.Text == KnownResourceStates.Waiting 286if (terminalEvent.Snapshot.State?.Text == KnownResourceStates.FailedToStart) 421snapshot.State?.Text == KnownResourceStates.Building 435var state = resourceEvent.Snapshot.State?.Text;
ApplicationModel\CustomResourceSnapshot.cs (3)
117HealthStatus = ComputeHealthStatus(value, State?.Text); 207State != 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, 661CanTransitionToWaiting(s.State?.Text, allowNotStarted) 900if (!string.Equals(newState.State?.Text, KnownResourceStates.Waiting, StringComparisons.ResourceState)) 959if (_logger.IsEnabled(LogLevel.Debug) && newState.State?.Text is { Length: > 0 } newStateText && !string.IsNullOrWhiteSpace(newStateText)) 961var previousStateText = previousState?.State?.Text; 998newState.State?.Text, 999newState.State?.Style, 1058var previousState = previousSnapshot?.State?.Text; 1059var newState = snapshot.State?.Text; 1277HiddenBehavior.OnCompletion => IsCompletionState(previousState.State?.Text) 1363WriteValue("Current State", snapshot.State?.Text); 1401error.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)
147var healthStatus = CustomResourceSnapshot.ComputeHealthStatus(resourceEvent.Snapshot.HealthReports, resourceEvent.Snapshot.State?.Text); 153State = 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, 1214State = snapshot.State?.Text, 1216StateStyle = snapshot.State?.Style,
Dashboard\DashboardServiceData.cs (2)
84State = snapshot.State?.Text, 85StateStyle = snapshot.State?.Style,
Dcp\DcpExecutor.cs (1)
832initial.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)
867var value = $@"Type = {Resource.GetType().Name}, Name = ""{Resource.Name}"", State = {Snapshot?.State?.Text ?? "(null)"}"; 874if (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)); 405if (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) 723if (s.State?.Text == KnownResourceStates.Waiting)
ResourceBuilderExtensions.cs (1)
4093var resourceState = context.ResourceSnapshot.State?.Text;
Aspire.Hosting.Azure (6)
AzureProvisioningController.cs (6)
1035var state = snapshot.State?.Text; 1041var state = snapshot.State?.Text; 2257environmentEvent.Snapshot.State?.Text != KnownResourceStates.Running) 3513return resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running; 3966string.Equals(currentEvent.Snapshot.State?.Text, state, StringComparison.Ordinal); 3972currentEvent.Snapshot.State is { Text: { } stateText } currentState &&
Aspire.Hosting.Azure.EntraId.Tests (20)
EntraIdInitializationTests.cs (19)
27Assert.Equal(KnownResourceStates.Running, snapshot.State?.Text); 59Assert.Equal(KnownResourceStates.Running, snapshot.State?.Text); 80Assert.Equal(KnownResourceStates.Running, snapshot.State?.Text); 112Assert.Equal(KnownResourceStates.Running, snapshot.State?.Text); 133Assert.Equal(KnownResourceStates.Running, snapshot.State?.Text); 152Assert.Equal(KnownResourceStates.FailedToStart, snapshot.State?.Text); 172Assert.Equal(KnownResourceStates.FailedToStart, snapshot.State?.Text); 190Assert.Equal(KnownResourceStates.FailedToStart, snapshot.State?.Text); 210Assert.Equal(KnownResourceStates.Running, snapshot.State?.Text); 229Assert.Equal(KnownResourceStates.FailedToStart, snapshot.State?.Text); 257Assert.Equal("Missing subscription configuration", resourceEvent.Snapshot.State?.Text); 281update => update.Snapshot.State?.Text == KnownResourceStates.FailedToStart, cts.Token); 294Assert.Equal(KnownResourceStates.Running, ready.Snapshot.State?.Text); 337update => update.Snapshot.State?.Text == KnownResourceStates.Running && 416Assert.Equal(KnownResourceStates.FailedToStart, snapshot.State?.Text); 445Assert.Equal(KnownResourceStates.Running, snapshot.State?.Text); 467Assert.Equal(KnownResourceStates.Running, snapshot.State?.Text); 481Assert.Equal(KnownResourceStates.FailedToStart, snapshot.State?.Text); 504update => update.Snapshot.State?.Text == KnownResourceStates.FailedToStart ||
EntraIdResourceBuilderTests.cs (1)
294Assert.Equal(KnownResourceStates.Waiting, annotation.InitialSnapshot.State?.Text);
Aspire.Hosting.Azure.Kusto (2)
AzureKustoBuilderExtensions.cs (2)
386return context.ResourceSnapshot.State?.Text == KnownResourceStates.Running ? ResourceCommandState.Enabled : ResourceCommandState.Disabled; 397return context.ResourceSnapshot.State?.Text == KnownResourceStates.Running ? ResourceCommandState.Enabled : ResourceCommandState.Disabled;
Aspire.Hosting.Azure.Tests (53)
AzureBicepProvisionerTests.cs (3)
1246Assert.Equal("Azure deployment failed", resourceEvent.Snapshot.State?.Text); 1361Assert.Equal("Azure deployment failed", resourceEvent.Snapshot.State?.Text); 1829Assert.Equal("Azure deployment canceled", resourceEvent.Snapshot.State?.Text);
AzureEnvironmentResourceExtensionsTests.cs (50)
121Assert.Equal(KnownResourceStates.Running, directorySnapshot.Snapshot.State?.Text); 677Assert.Equal(KnownResourceStates.NotStarted, environmentEvent.Snapshot.State?.Text); 681Assert.Equal(KnownResourceStates.NotStarted, storageEvent.Snapshot.State?.Text); 793Assert.Equal("Running", storageEvent.Snapshot.State?.Text); 818Assert.Equal(KnownResourceStates.Running, resourceEvent.Snapshot.State?.Text); 891Assert.Equal(KnownResourceStates.Running, storageEvent.Snapshot.State?.Text); 1729Assert.Equal("Canceled", storageEvent.Snapshot.State?.Text); 2067Assert.Equal(KnownResourceStates.Running, storageEvent.Snapshot.State?.Text); 2170Assert.Equal(KnownResourceStates.NotStarted, storageEvent.Snapshot.State?.Text); 2173Assert.Equal(KnownResourceStates.Running, storage2Event.Snapshot.State?.Text); 2252Assert.Equal(KnownResourceStates.NotStarted, keyVaultEvent.Snapshot.State?.Text); 2318Assert.Equal("Deleting", storageEvent.Snapshot.State?.Text); 2406Assert.Equal("Canceled", storageEvent.Snapshot.State?.Text); 2479Assert.Equal(KnownResourceStates.NotStarted, storageEvent.Snapshot.State?.Text); 2484Assert.Equal(KnownResourceStates.Running, storage2Event.Snapshot.State?.Text); 2541Assert.Equal("Running", storageEvent.Snapshot.State?.Text); 2544Assert.Equal(KnownResourceStates.Running, storage2Event.Snapshot.State?.Text); 2821Assert.Equal("Canceling", storageEvent.Snapshot.State?.Text); 2824Assert.Equal("Canceling", blobsEvent.Snapshot.State?.Text); 2833Assert.Equal("Canceled", storageEvent.Snapshot.State?.Text); 2900storageEvent.Snapshot.State?.Text is "Canceling" or "Canceled", 2901$"Expected storage to be canceling or canceled, but it was '{storageEvent.Snapshot.State?.Text}'."); 2903Assert.Equal("Running", storage2Event.Snapshot.State?.Text); 2908Assert.Equal("Running", storage2Event.Snapshot.State?.Text); 3383Assert.Equal(KnownResourceStates.Running, storageEvent.Snapshot.State?.Text); 3828Assert.Equal(KnownResourceStates.Running, environmentEvent.Snapshot.State?.Text); 4279Assert.Equal("Running", keyVaultEvent.Snapshot.State?.Text); 4383Assert.Equal("Failed to Provision", keyVaultEvent.Snapshot.State?.Text); 4590Assert.Equal("Failed to Provision", storageEvent.Snapshot.State?.Text); 4676Assert.Equal(AzureProvisioningController.DriftedState, environmentEvent.Snapshot.State?.Text); 4677Assert.Equal(KnownResourceStateStyles.Error, environmentEvent.Snapshot.State?.Style); 4685Assert.Equal(AzureProvisioningController.MissingInAzureState, resourceEvent.Snapshot.State?.Text); 4686Assert.Equal(KnownResourceStateStyles.Error, resourceEvent.Snapshot.State?.Style); 4729Assert.Equal(KnownResourceStates.Running, environmentEvent.Snapshot.State?.Text); 4732Assert.Equal(KnownResourceStates.Running, resourceEvent.Snapshot.State?.Text); 4788Assert.Equal(AzureProvisioningController.DriftedState, environmentEvent.Snapshot.State?.Text); 4791Assert.Equal(KnownResourceStates.Running, storageEvent.Snapshot.State?.Text); 4794Assert.Equal(AzureProvisioningController.MissingInAzureState, storage2Event.Snapshot.State?.Text); 4795Assert.Equal(KnownResourceStateStyles.Error, storage2Event.Snapshot.State?.Style); 4831Assert.Equal(KnownResourceStates.Running, environmentEvent.Snapshot.State?.Text); 4834Assert.Equal(KnownResourceStates.Running, resourceEvent.Snapshot.State?.Text); 5028Assert.Equal("Failed to Delete", environmentEvent.Snapshot.State?.Text); 5095Assert.Equal("Failed to Provision", storageEvent.Snapshot.State?.Text); 5098Assert.Equal("Failed to Provision", storageRolesEvent.Snapshot.State?.Text); 5166Assert.Equal(AzureProvisioningController.CancelingState, storageEvent.Snapshot.State?.Text); 5172Assert.Equal(AzureProvisioningStrings.ResourceStateCanceled, storageEvent.Snapshot.State?.Text); 5173Assert.Equal(KnownResourceStateStyles.Info, storageEvent.Snapshot.State?.Style); 5196Assert.Equal("Failed to Provision", environmentEvent.Snapshot.State?.Text); 5514resourceEvent.Snapshot.State?.Text == expectedState) 5530? finalEvent.Snapshot.State?.Text
Aspire.Hosting.Blazor (3)
BlazorGatewayExtensions.cs (1)
523var 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 && 748&& previous.Snapshot.State?.Text == KnownResourceStates.Running 754StartTimeStamp = snapshot.State?.Text == KnownResourceStates.Running ? snapshot.StartTimeStamp : DateTime.UtcNow, 831&& 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); 501Assert.Equal(KnownResourceStates.Finished, test.Snapshot(test.Port).State?.Text); 529Assert.Equal(KnownResourceStates.Finished, test.Snapshot(test.Port).State?.Text); 613Assert.Equal(KnownResourceStates.Finished, test.Snapshot(test.Port).State?.Text); 767Assert.Equal(KnownResourceStates.Finished, test.Snapshot(test.Port).State?.Text);
DevTunnelResourceBuilderExtensionsTests.cs (2)
826Assert.Equal(restartBeforeUrlCallbackCompletes ? KnownResourceStates.Running : KnownResourceStates.Finished, completed.Snapshot.State?.Text); 846e => e.Snapshot.State?.Text == KnownResourceStates.Running &&
TestDevTunnelMonitor.cs (1)
89e => e.Snapshot.State?.Text == KnownResourceStates.Running && e.Snapshot.HealthStatus == Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus.Healthy).DefaultTimeout();
Aspire.Hosting.Dotnet (7)
DotnetProjectBuildCoordinator.cs (7)
216if (buildEvent.Snapshot.State?.Text != KnownResourceStates.FailedToStart && 381snapshot.State?.Text == KnownResourceStates.FailedToStart || 382(KnownResourceStates.TerminalStates.Contains(snapshot.State?.Text) && 387(snapshot.State?.Text == KnownResourceStates.FailedToStart || snapshot.ExitCode is not 0); 519rebuildEvent.Snapshot.State?.Text is { } state && 1560(resourceEvent.Snapshot.State?.Text == KnownResourceStates.FailedToStart || 1561KnownResourceStates.TerminalStates.Contains(resourceEvent.Snapshot.State?.Text)),
Aspire.Hosting.Dotnet.Tests (13)
DotnetProjectBuildCoordinatorTests.cs (13)
934resourceEvent.Snapshot.State?.Text == KnownResourceStates.Finished && 940resourceEvent.Snapshot.State?.Text == KnownResourceStates.Finished && 3808resourceEvent => resourceEvent.ResourceId == name && resourceEvent.Snapshot.State?.Text == KnownResourceStates.Finished, 3864resourceEvent => resourceEvent.ResourceId == name && resourceEvent.Snapshot.State?.Text == KnownResourceStates.FailedToStart, 3971Assert.Equal(KnownResourceStates.Finished, firstBuildEvent.Snapshot.State?.Text); 3973Assert.Equal(KnownResourceStates.FailedToStart, secondBuildEvent.Snapshot.State?.Text); 4252Assert.Equal(KnownResourceStates.NotStarted, projectEvent.Snapshot.State?.Text); 4670KnownResourceStates.TerminalStates.Contains(resourceEvent.Snapshot.State?.Text) && 4725resourceEvent => resourceEvent.Snapshot.State?.Text == KnownResourceStates.Starting, 4746resourceEvent => resourceEvent.Snapshot.State?.Text == KnownResourceStates.Starting, 4769Assert.Equal(KnownResourceStates.Finished, buildEvent.Snapshot.State?.Text); 4777resourceEvent => resourceEvent.Snapshot.State?.Text == KnownResourceStates.FailedToStart, 4779Assert.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)
238Assert.Equal("NotStarted", snapshotAnnotation.InitialSnapshot.State?.Text);
EFBuildReadinessTests.cs (1)
52Assert.Equal(KnownResourceStates.Finished, state.Snapshot.State?.Text);
Aspire.Hosting.Maui (8)
Lifecycle\MauiBuildQueueEventSubscriber.cs (6)
338e => ShouldReleaseBuildLockForLaunchState(e.Snapshot.State?.Text, stateAtCallTime, releaseOnRunning), 409e => ShouldReleaseBuildLockForLaunchState(e.Snapshot.State?.Text, stateAtCallTime, releaseOnRunning: false), 529var state = context.ResourceSnapshot.State?.Text; 564e => string.Equals(e.Snapshot.State?.Text, KnownResourceStates.FailedToStart, StringComparisons.ResourceState), 584if (s.State?.Text is not null && 585!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 (2)
MauiBuildQueueTests.cs (2)
548if (context.ResourceSnapshot.State?.Text == "Queued" && !cancelledWhileQueued) 1186env.NotificationService.WaitForResourceAsync(resource.Name, evt => evt.Snapshot.State?.Text == state).DefaultTimeout();
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, 134resourceEvent => resourceEvent.Snapshot.State?.Text == updatedState,
Aspire.Hosting.Tests (143)
AddConnectionStringTests.cs (1)
67Assert.Equal(KnownResourceStates.NotStarted, state.State?.Text);
Dcp\ResourceSnapshotBuilderTests.cs (2)
795Assert.Equal(KnownResourceStates.NotStarted, snapshot.State?.Text); 825Assert.Equal(KnownResourceStates.NotStarted, snapshot.State?.Text);
DistributedApplicationTests.cs (32)
263var resourceEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Waiting, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 267await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 271await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Finished, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 275await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Waiting, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 279await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 309var notStartedResourceEvent = await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 310var dependentResourceEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Waiting, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 331var runningResourceEvent = await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 339var dependentResourceRunningEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 352await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Finished, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 356await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 408var normalResource = await rns.WaitForResourceAsync(normalResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, startupToken).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 411await rns.WaitForResourceAsync(explicitStartResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, startupToken).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 470var notStartedResourceEvent = await rns.WaitForResourceAsync(explicitStartResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 479await rns.WaitForResourceAsync(explicitStartResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); 624e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, 629e => e.Snapshot.State?.Text == KnownResourceStates.Waiting, 651var runningResourceEvent = await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 658var dependentRunningResourceEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 667await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Exited, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 671await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 713notStartedResourceEvent = await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.NotStarted, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 714dependentResourceEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Waiting, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 736var runningResourceEvent = await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 743var dependentRunningResourceEvent = await rns.WaitForResourceAsync(dependentResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 752await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Exited, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 759await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan); 1184var dependentRunningResourceEvent = await rns.WaitForResourceAsync(container.Resource.Name, e => e.Snapshot.State?.Text == KnownResourceStates.Running).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 2200var state = e.Snapshot.State?.Text; 2209var state = e.Snapshot.State?.Text; 2245e => e.Snapshot.State?.Text == KnownResourceStates.Running && 2250e => e.Snapshot.State?.Text == KnownResourceStates.Running &&
ExternalServiceTests.cs (6)
343e => e.Snapshot.State?.Text == KnownResourceStates.FailedToStart 347Assert.Equal(KnownResourceStates.FailedToStart, resourceEvent.Snapshot.State?.Text); 370e => e.Snapshot.State?.Text == KnownResourceStates.FailedToStart 374Assert.Equal(KnownResourceStates.FailedToStart, resourceEvent.Snapshot.State?.Text); 397e => e.Snapshot.State?.Text == KnownResourceStates.Running 401Assert.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)
544Assert.Equal(KnownResourceStates.Finished, @event.ResourceEvent.Snapshot.State?.Text); 574snapshot => snapshot with { State = state is not null ? new(state, null) : snapshot.State, ExitCode = state == KnownResourceStates.Finished ? 0 : null })); 1069Assert.Equal(KnownResourceStates.FailedToStart, snapshotEvent.Snapshot.State?.Text); 1070Assert.Equal(KnownResourceStateStyles.Error, snapshotEvent.Snapshot.State?.Style); 1097Assert.Equal(KnownResourceStates.FailedToStart, snapshotEvent.Snapshot.State?.Text); 1098Assert.Null(snapshotEvent.Snapshot.State?.Style); 1121Assert.Equal(KnownResourceStates.Starting, snapshotEvent.Snapshot.State?.Text); 1153Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 1194Assert.NotEqual(KnownResourceStates.Running, dependencyEvent.Snapshot.State?.Text); 1242e => e.ResourceId == "waiter-abc123" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 1300e => e.ResourceId == "waiter-abc123" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 1304Assert.Equal(KnownResourceStates.NotStarted, siblingEvent.Snapshot.State?.Text); 1351e => e.ResourceId == "waiter-abc123" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 1405e => e.ResourceId == "waiter-abc123" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 1413e => e.ResourceId == "waiter-def456" && e.Snapshot.State?.Text == KnownResourceStates.Waiting, 1467Assert.NotEqual(KnownResourceStates.Running, blockerEvent.Snapshot.State?.Text); 1516|| waiterEvent.Snapshot.State?.Text != KnownResourceStates.Waiting) 1533Assert.NotEqual(KnownResourceStates.Running, blockerEvent.Snapshot.State?.Text); 1600re => re.Snapshot.State?.Text == KnownResourceStates.Waiting, 1869var parentState = resourceNotificationService.TryGetCurrentState("parent-container-dcp", out var parentEvent) ? parentEvent.Snapshot.State?.Text : null; 1870var childContainerState = resourceNotificationService.TryGetCurrentState(childContainer.Resource.Name, out var childContainerEvent) ? childContainerEvent.Snapshot.State?.Text : null; 1871var customChildState = resourceNotificationService.TryGetCurrentState(customChild.Resource.Name, out var customChildEvent) ? customChildEvent.Snapshot.State?.Text : null; 1917var parentState = resourceNotificationService.TryGetCurrentState("parent-container-dcp", out var parentEvent) ? parentEvent.Snapshot.State?.Text : null; 1918var childProjectState = resourceNotificationService.TryGetCurrentState(childProject.Resource.Name, out var childProjectEvent) ? childProjectEvent.Snapshot.State?.Text : null; 1919var customChildState = resourceNotificationService.TryGetCurrentState(customChild.Resource.Name, out var customChildEvent) ? customChildEvent.Snapshot.State?.Text : null;
Orchestrator\ParameterProcessorTests.cs (20)
104Assert.Equal(KnownResourceStates.Running, snapshot.State?.Text); 144Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 340Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 344Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 348Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 2256Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 2295Assert.Equal(KnownResourceStates.ValueMissing, updates.Current.Snapshot.State?.Text); 2445Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 2463Assert.Equal(KnownResourceStates.ValueMissing, updates.Current.Snapshot.State?.Text); 2475Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 2496Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 2513Assert.Equal(KnownResourceStates.ValueMissing, updates.Current.Snapshot.State?.Text); 2525Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 2544Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 2551Assert.Equal(KnownResourceStates.ValueMissing, updates.Current.Snapshot.State?.Text); 2596Assert.Equal(clearValue ? KnownResourceStates.ValueMissing : KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 2631Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text); 2638Assert.Equal(KnownResourceStates.ValueMissing, updates.Current.Snapshot.State?.Text); 2665Assert.Equal(KnownResourceStates.ValueMissing, updates.Current.Snapshot.State?.Text); 2672Assert.Equal(KnownResourceStates.Running, updates.Current.Snapshot.State?.Text);
ResourceCommandAnnotationTests.cs (1)
297Assert.Equal(expected, restored.State?.Text);
ResourceCommandServiceTests.cs (6)
1764await resourceNotificationService.WaitForResourceAsync(project.Resource.Name, e => KnownResourceStates.BuildableStates.Contains(e.Snapshot.State?.Text), cts.Token).DefaultTimeout(TimeSpan.FromMinutes(2)); 1818await resourceNotificationService.WaitForResourceAsync(project.Resource.Name, e => e.ResourceId == replicaName && e.Snapshot.State?.Text == KnownResourceStates.Finished, finishedCts.Token).DefaultTimeout(TimeSpan.FromMinutes(2)); 1829await resourceNotificationService.WaitForResourceAsync(project.Resource.Name, e => e.ResourceId == replicaNames[1] && e.Snapshot.State?.Text == KnownResourceStates.Running, restartCts.Token).DefaultTimeout(TimeSpan.FromMinutes(2)); 1833Assert.Equal(KnownResourceStates.Running, activeReplica.Snapshot.State?.Text); 1840Assert.Equal(KnownResourceStates.Finished, inactiveReplica.Snapshot.State?.Text); 1844await resourceNotificationService.WaitForResourceAsync(project.Resource.Name, e => e.ResourceId == replicaNames[1] && e.Snapshot.State?.Text == KnownResourceStates.Running, runningCts.Token).DefaultTimeout(TimeSpan.FromMinutes(2));
ResourceNotificationTests.cs (29)
530re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 534Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 543re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 634re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 638Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 652re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 690re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 694Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 704re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 744re => re.Snapshot.State?.Text == KnownResourceStates.Waiting, 747Assert.Equal(KnownResourceStates.Waiting, waitingEvent.Snapshot.State?.Text); 790Assert.Equal(state, resourceEvent.Snapshot.State?.Text); 824re => re.ResourceId == "resource-abc123" && re.Snapshot.State?.Text == KnownResourceStates.Waiting, 828Assert.Equal(KnownResourceStates.NotStarted, notStartedEvent.Snapshot.State?.Text); 838Assert.Equal(KnownResourceStates.NotStarted, notStartedEvent.Snapshot.State?.Text); 868Assert.Equal(KnownResourceStates.NotStarted, notStartedEvent.Snapshot.State?.Text); 895re => re.Snapshot.State?.Text == KnownResourceStates.Waiting, 934re => re.ResourceId == "resource-abc123" && re.Snapshot.State?.Text == KnownResourceStates.Waiting, 966re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 979re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 1070re => re.Snapshot.State?.Text == KnownResourceStates.Waiting && 1297Assert.Equal("Running", secondEvent.Snapshot.State?.Text); 1334Assert.Equal("Starting", value.Snapshot.State?.Text); 1370Assert.Equal("Starting", value.Snapshot.State?.Text); 1627return resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running; 1637Assert.Equal(KnownResourceStates.Running, (await waitTask.DefaultTimeout()).Snapshot.State?.Text); 1670return resourceEvent.Snapshot.State?.Text == KnownResourceStates.Running; 1674Assert.Equal(KnownResourceStates.Running, (await waitTask).Snapshot.State?.Text); 1929Assert.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)
123TestOutputHelper.WriteLine($"Captured snapshot #{urlSnapshots.Count}: State={notification.Snapshot.State}, URLs: {FormatUrls(notification.Snapshot.Urls)}"); 126if (notification.Snapshot.State == KnownResourceStates.Running && 675e => e.Snapshot.State == KnownResourceStates.Running 711TestOutputHelper.WriteLine($"Captured snapshot #{urlSnapshots.Count}: State={notification.Snapshot.State}, URLs: {FormatUrls(notification.Snapshot.Urls)}"); 714if (notification.Snapshot.State == KnownResourceStates.Running && 785e => e.Snapshot.State == KnownResourceStates.Running && e.Snapshot.Urls.Length == 4).DefaultTimeout(); 1118e => e.Snapshot.State == KnownResourceStates.Running 1170e => 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)));