TestCluster Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A host class for local testing with Orleans using in-process silos. Runs a Primary and optionally secondary silos in separate app domains, and client in the main app domain. Additional silos can also be started in-process on demand if required for particular test cases.
public class TestCluster
public class TestCluster : IDisposable
public class TestCluster : IAsyncDisposable, IDisposable
type TestCluster = class
type TestCluster = class
interface IDisposable
type TestCluster = class
interface IDisposable
interface IAsyncDisposable
Public Class TestCluster
Public Class TestCluster
Implements IDisposable
Public Class TestCluster
Implements IAsyncDisposable, IDisposable
- Inheritance
-
TestCluster
- Implements
Remarks
Make sure that your test project references your test grains and test grain interfaces projects, and has CopyLocal=True set on those references [which should be the default].
Constructors
TestCluster() |
Configure the default Primary test silo, plus client in-process. |
TestCluster(ClusterConfiguration, ClientConfiguration) |
Configures the test cluster plus client in-process, using the specified silo and client config configurations. |
TestCluster(ClusterConfiguration) |
Configures the test cluster plus default client in-process. |
TestCluster(TestClusterOptions, IReadOnlyList<IConfigurationSource>, ITestClusterPortAllocator) |
Configures the test cluster plus client in-process. |
TestCluster(TestClusterOptions, IReadOnlyList<IConfigurationSource>) |
Configures the test cluster plus client in-process. |
TestCluster(TestClusterOptions) |
Configures the test cluster plus client in-process. |
Properties
Client |
The client. |
ClientConfiguration |
Client configuration to use when initializing the client |
ClusterConfiguration |
Cluster configuration |
ConfigurationSources |
Gets the configuration sources. |
CreateSiloAsync |
Delegate used to create and start an individual silo. |
DeploymentId |
DeploymentId of the cluster |
GrainFactory |
GrainFactory to use in the tests |
Options |
Options used to configure the test cluster. |
PortAllocator |
The port allocator. |
Primary |
Primary silo handle, if applicable. |
SecondarySilos |
List of handles to the secondary silos. |
SerializationManager |
SerializationManager to use in the tests |
ServiceProvider |
Client-side IServiceProvider to use in the tests. |
Silos |
Collection of all known silos. |
StreamProviderManager |
The client-side StreamProviderManager. |
Methods
DefaultCreateSiloAsync(String, IConfiguration) |
Default value for CreateSiloAsync, which creates a new silo handle. |
Deploy() |
Deploys the cluster using the specified configuration and starts the client in-process. It will start the number of silos defined in InitialSilosCount. |
Deploy(IEnumerable<String>) |
Deploys the cluster using the specified configuration and starts the client in-process. |
DeployAsync() |
Deploys the cluster using the specified configuration and starts the client in-process. |
DeployAsync(IEnumerable<String>) |
Deploys the cluster using the specified configuration and starts the client in-process. |
Dispose() | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
DisposeAsync() | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously. |
GetActiveSilos() |
Get the list of current active silos. |
GetLivenessStabilizationTime(ClusterMembershipOptions, Boolean) |
Get the timeout value to use to wait for the silo liveness sub-system to detect and act on any recent cluster membership changes. |
GetLivenessStabilizationTime(GlobalConfiguration, Boolean) |
Get the timeout value to use to wait for the silo liveness sub-system to detect and act on any recent cluster membership changes. |
GetLog() |
Gets the log. |
GetSiloForAddress(SiloAddress) |
Find the silo handle for the specified silo address. |
InitializeClient() |
Initialize the grain client. This should be already done by Deploy() or DeployAsync(IEnumerable<String>) |
InitializeClientAsync() |
Initialize the grain client. This should be already done by Deploy() or DeployAsync() |
KillClient() |
Performs a hard kill on client. Client will not cleanup resources. |
KillClientAsync() |
Performs a hard kill on client. Client will not cleanup resources. |
KillSilo(SiloHandle) |
Do an immediate Kill of the specified silo. |
KillSiloAsync(SiloHandle) |
Do an immediate Kill of the specified silo. |
RestartSilo(SiloHandle) |
Do a Stop or Kill of the specified silo, followed by a restart. |
RestartSiloAsync(SiloHandle) |
Do a Stop or Kill of the specified silo, followed by a restart. |
RestartStoppedSecondarySilo(String) |
Restart a previously stopped. |
RestartStoppedSecondarySiloAsync(String) |
Restart a previously stopped. |
StartAdditionalSilo() |
Start an additional silo, so that it joins the existing cluster. |
StartAdditionalSilo(Boolean) |
Start an additional silo, so that it joins the existing cluster. |
StartAdditionalSiloAsync(Boolean) |
Start an additional silo, so that it joins the existing cluster. |
StartAdditionalSilos(Int32) |
Start a number of additional silo, so that they join the existing cluster. |
StartAdditionalSilosAsync(Int32, Boolean) |
Start a number of additional silo, so that they join the existing cluster. |
StartOrleansSilo(TestCluster, Silo+SiloType, ClusterConfiguration, NodeConfiguration) |
Start a new silo in the target cluster |
StartSiloAsync(Int32, TestClusterOptions, IReadOnlyList<IConfigurationSource>, Boolean) |
Starts a new silo. |
StartSiloAsync(TestCluster, Int32, TestClusterOptions, IReadOnlyList<IConfigurationSource>, Boolean) |
Start a new silo in the target cluster |
StopAllSilos() |
Stop all current silos. |
StopAllSilosAsync() |
Stop all current silos. |
StopClusterClientAsync() |
Stop cluster client as an asynchronous operation. |
StopPrimarySilo() |
Stops the default Primary silo. |
StopPrimarySiloAsync() |
Stops the default Primary silo. |
StopSecondarySilos() |
Stop any additional silos, not including the default Primary silo. |
StopSecondarySilosAsync() |
Stop any additional silos, not including the default Primary silo. |
StopSilo(SiloHandle) |
Do a semi-graceful Stop of the specified silo. |
StopSiloAsync(SiloHandle) |
Do a semi-graceful Stop of the specified silo. |
WaitForLivenessToStabilizeAsync(Boolean) |
Wait for the silo liveness sub-system to detect and act on any recent cluster membership changes. |