Invoke-ServiceFabricFailoverTestScenario

Invoke-ServiceFabricFailoverTestScenario

Invokes a test scenario to induce faults in a Service Fabric partition.

Syntax

Parameter Set: PartitionId
Invoke-ServiceFabricFailoverTestScenario -MaxServiceStabilizationTimeoutSec <UInt32> -PartitionId <Guid> -ServiceName <Uri> -TimeToRunMinute <UInt32> [-TimeoutSec <Int32]> ] [-WaitTimeBetweenFaultsSec <Int32]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionNamed
Invoke-ServiceFabricFailoverTestScenario -MaxServiceStabilizationTimeoutSec <UInt32> -PartitionKey <String> -PartitionKindNamed -ServiceName <Uri> -TimeToRunMinute <UInt32> [-TimeoutSec <Int32]> ] [-WaitTimeBetweenFaultsSec <Int32]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionSingleton
Invoke-ServiceFabricFailoverTestScenario -MaxServiceStabilizationTimeoutSec <UInt32> -PartitionKindSingleton -ServiceName <Uri> -TimeToRunMinute <UInt32> [-TimeoutSec <Int32]> ] [-WaitTimeBetweenFaultsSec <Int32]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionUniformedInt
Invoke-ServiceFabricFailoverTestScenario -MaxServiceStabilizationTimeoutSec <UInt32> -PartitionKey <String> -PartitionKindUniformInt64 -ServiceName <Uri> -TimeToRunMinute <UInt32> [-TimeoutSec <Int32]> ] [-WaitTimeBetweenFaultsSec <Int32]> ] [ <CommonParameters>]

Parameter Set: ServiceNameRandomPartition
Invoke-ServiceFabricFailoverTestScenario -MaxServiceStabilizationTimeoutSec <UInt32> -ServiceName <Uri> -TimeToRunMinute <UInt32> [-TimeoutSec <Int32]> ] [-WaitTimeBetweenFaultsSec <Int32]> ] [ <CommonParameters>]




Detailed Description

The Invoke-ServiceFabricFailoverTestScenario cmdlet starts a test scenario to induce faults in a Service Fabric partition. The test puts the partition through specific failover scenarios to ensure those paths are exercised. If you run a workload against a Service Fabric service while the cmdlet runs its tests, you increase the chance of discovering bugs in the service.

The faults induced for the primary, secondary, and stateless instances are:

-- RestartReplica (only persisted)
-- RemoveReplica
-- ResartDeployedCodePackage
-- MovePrimary (only stateful)
-- MoveSecondary (only stateful)
-- RestartPartition (no data loss)

Before using this cmdlet, connect to the Service Fabric cluster.

Parameters

-MaxServiceStabilizationTimeoutSec<UInt32>

Specifies the maximum time-out period, in seconds, for the service to stabilize before failing the test.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PartitionId<Guid>

Specifies the ID of the partition to test.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-PartitionKey<String>

Specifies the key of the partition on which to invoke the test.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-PartitionKindNamed

Indicates that this cmdlet tests a named partition.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PartitionKindSingleton

Indicates that this cmdlet tests a singleton partition.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PartitionKindUniformInt64

Indicates that this cmdlet tests a UniformInt64 partitioned service.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ServiceName<Uri>

Specifies the name of the service to test.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-TimeoutSec<Int32]>

Specifies the time-out period, in seconds, for the operation.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TimeToRunMinute<UInt32>

Specifies the total time, in minutes, for the scenario to run.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WaitTimeBetweenFaultsSec<Int32]>

Specifies the maximum wait time, in seconds, between consecutive faults. The larger the value the lower the concurrency.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • System.Guid

    Represents the ID of a Service Fabric partition.


  • System.Uri

    Represents the name of a Service Fabric service.


Outputs

The output type is the type of the objects that the cmdlet emits.

  • System.Object

    This cmdlet returns a String object that represents the final status of the test run.


Examples

Example 1: Run a failover test

The first four commands store values in variables to use as parameters. The final command runs the failover test for 60 minutes with a maximum stabilization time of 180 seconds for the singleton service named fabric:/SampleApp/SampleService.


PS C:\> $TimeToRun = 60
PS C:\> $MaxStabilizationTimeSecs = 180
PS C:\> $WaitTimeBetweenFaultsSec = 10
PS C:\> $ServiceName = "fabric:/SampleApp/SampleService"

PS C:\> Invoke-ServiceFabricFailoverTestScenario -TimeToRunMinute $TimeToRun -MaxServiceStabilizationTimeoutSec $MaxStabilizationTimeSecs -WaitTimeBetweenFaultsSec $WaitTimeBetweenFaultsSec -ServiceName $ServiceName -PartitionKindSingleton

Related topics

Show: