TestingSiloHost Class

Definition

Caution

Use TestCluster

Important note: TestingSiloHost will be eventually deprectated. It is recommended that you use TestCluster instead. A host class for local testing with Orleans using in-process silos.

Runs a Primary and Secondary silo in seperate app domains, and client in the main app domain. Additional silos can also be started in-process if required for particular test cases.

[System.Obsolete("Use TestCluster", false)]
public class TestingSiloHost
[<System.Obsolete("Use TestCluster", false)>]
type TestingSiloHost = class
Public Class TestingSiloHost
Inheritance
TestingSiloHost
Attributes

Remarks

Make sure the following files are included in any test projects that use TestingSiloHost, and ensure "Copy if Newer" is set to ensure the config files are included in the test set.

OrleansConfigurationForTesting.xml
ClientConfigurationForTesting.xml

Also 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

TestingSiloHost()

Start the default Primary and Secondary test silos, plus client in-process, using the default silo config options.

TestingSiloHost(Boolean)

Start the default Primary and Secondary test silos, plus client in-process, ensuring that fresh silos are started if they were already running.

TestingSiloHost(TestingSiloOptions, TestingClientOptions)

Start the default Primary and Secondary test silos, plus client in-process, using the specified silo and client config options.

TestingSiloHost(TestingSiloOptions)

Start the default Primary and Secondary test silos, plus client in-process, using the specified silo config options.

Fields

BasePort

Base port number for silos in cluster

DeploymentId

The deploymentId value to use in the cluster

DeploymentIdPrefix

The prefix to use in the deploymentId

ProxyBasePort

Base port number for the gateway silos

Properties

Client

Gets the client.

ClientConfig

Get or set the client configuration///

Globals

Get or set the global configuration

GrainFactory

GrainFactory to use in the tests

Instance

Single instance of TestingSiloHost

Primary

Primary silo handle

Secondary

List of handles to the secondary silos

Methods

AdjustForTest(ClientConfiguration, TestingClientOptions)

Modify the ClientConfiguration to the test environment

AdjustForTest(ClusterConfiguration, TestingSiloOptions)

Modify the cluster configurations to the test environment

CreateUninitialized()

Create a new TestingSiloHost without initialization

GetActiveSilos()

Get the list of current active silos.

GetSiloForAddress(SiloAddress)

Find the silo handle for the specified silo address.

InitializeClient()

Initialize the grain client

KillClient()

Performs a hard kill on client. Client will not cleanup reasources.

KillSilo(SiloHandle)

Do an immediate Kill of the specified silo.

RedeployTestingSiloHost(TestingSiloOptions, TestingClientOptions)

Stop the TestingSilo and restart it.

RestartAllAdditionalSilos()

Restart all additional silos, not including the default Primary and Secondary silos.

RestartDefaultSilos(Boolean)

Restart the default Primary and Secondary silos.

RestartSilo(SiloHandle)

Do a Stop or Kill of the specified silo, followed by a restart.

StartAdditionalSilo()

Start an additional silo, so that it joins the existing cluster with the default Primary and Secondary silos.

StartAdditionalSilos(Int32)

Start a number of additional silo, so that they join the existing cluster with the default Primary and Secondary silos.

StartOrleansSilo(TestingSiloHost, Silo+SiloType, TestingSiloOptions, Int32, AppDomain)

Start a new silo in the target cluster

StartSecondarySilo(TestingSiloOptions, Int32)

Start a Secondary silo with a given instanceCounter (allows to set the port number as before or new, depending on the scenario).

StopAdditionalSilos()

Stop any additional silos, not including the default Primary and Secondary silos.

StopAllSilos()

Stop all current silos.

StopAllSilosIfRunning()

Stop all current silos if running.

StopDefaultSilos()

Stop the default Primary and Secondary silos.

StopSilo(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.

Applies to