Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
TestCluster Class
Definition
- Namespace:
- Orleans.TestingHost
- Assembly:
- OrleansTestingHost.dll
- Assembly:
- Orleans.TestingHost.dll
- Package:
- Microsoft.Orleans.TestingHost v1.5.10
- Package:
- Microsoft.Orleans.TestingHost v10.0.0
- Package:
- Microsoft.Orleans.TestingHost v2.4.5
- Package:
- Microsoft.Orleans.TestingHost v3.6.5
- Package:
- Microsoft.Orleans.TestingHost v7.2.5
- Package:
- Microsoft.Orleans.TestingHost v8.0.0
- Package:
- Microsoft.Orleans.TestingHost v8.1.0
- Package:
- Microsoft.Orleans.TestingHost v8.2.0
- Package:
- Microsoft.Orleans.TestingHost v9.0.0
- Package:
- Microsoft.Orleans.TestingHost v9.1.2
- Source:
- TestCluster.cs
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 : IAsyncDisposable, IDisposable
public class TestCluster : IDisposable
type TestCluster = class
type TestCluster = class
interface IDisposable
interface IAsyncDisposable
type TestCluster = class
interface IDisposable
Public Class TestCluster
Public Class TestCluster
Implements IAsyncDisposable, IDisposable
Public Class TestCluster
Implements 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
| Name | Description |
|---|---|
| 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
| Name | Description |
|---|---|
| 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
| Name | Description |
|---|---|
| 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. <seealso cref="M:Orleans.TestingHost.TestCluster.WaitForLivenessToStabilizeAsync(System.Boolean)"></seealso> |
| 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. <seealso cref="M:Orleans.TestingHost.TestCluster.WaitForLivenessToStabilizeAsync(System.Boolean)"></seealso> |
| GetLog() |
Gets the log. |
| GetSiloForAddress(SiloAddress) |
Find the silo handle for the specified silo address. |
| GetSiloServiceProvider(SiloAddress) |
Returns the IServiceProvider associated with the given |
| 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. |
