C# Class ChaosTest.ChaosService.ChaosService

This stateful service keeps inducing failovers and faults - chosen probabilistically - to the cluster, using ChaosTestScenario from Microsoft.ServiceFabric.Testability under the hood, hiding the fact that ChaosTestScenario runs in unit of iteration, giving the impression that the fault inducing is perennial.
Inheritance: StatefulService
Show file Open project: Azure-Samples/service-fabric-dotnet-testing-chaos-service Class Usage Examples

Public Methods

Method Description
ChaosService ( StatefulServiceContext context ) : System
GetEventsAsync ( ) : Task
StartAsync ( ) : Task

Starts the test.

StopAsync ( ) : Task

Protected Methods

Method Description
CreateServiceReplicaListeners ( ) : IEnumerable
RunAsync ( CancellationToken runAsyncCancellationToken ) : Task

Private Methods

Method Description
StoreEventAsync ( string eventString ) : Task

This method saves the description (eventString) and timestamp of the recentmost induced fault as a ChaosEntry in a Reliable Dictionary

TestScenarioProgressChanged ( object sender, ProgressChangedEventArgs e ) : void

This is the event-handler for the events coming into from ChaosTestScenario

Method Details

ChaosService() public method

public ChaosService ( StatefulServiceContext context ) : System
context StatefulServiceContext
return System

CreateServiceReplicaListeners() protected method

protected CreateServiceReplicaListeners ( ) : IEnumerable
return IEnumerable

GetEventsAsync() public method

public GetEventsAsync ( ) : Task
return Task

RunAsync() protected method

protected RunAsync ( CancellationToken runAsyncCancellationToken ) : Task
runAsyncCancellationToken System.Threading.CancellationToken
return Task

StartAsync() public method

Starts the test.
public StartAsync ( ) : Task
return Task

StopAsync() public method

public StopAsync ( ) : Task
return Task