Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Invoke-ServiceFabricFailoverTestScenario
- Module:
- ServiceFabric Module
Invokes a test scenario to induce faults in a Service Fabric partition.
Syntax
PartitionId
Invoke-ServiceFabricFailoverTestScenario
-MaxServiceStabilizationTimeoutSec <UInt32>
-TimeToRunMinute <UInt32>
-PartitionId <Guid>
-ServiceName <Uri>
[-WaitTimeBetweenFaultsSec <Int32>]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNameRandomPartition
Invoke-ServiceFabricFailoverTestScenario
-MaxServiceStabilizationTimeoutSec <UInt32>
-TimeToRunMinute <UInt32>
-ServiceName <Uri>
[-WaitTimeBetweenFaultsSec <Int32>]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNamePartitionSingleton
Invoke-ServiceFabricFailoverTestScenario
-MaxServiceStabilizationTimeoutSec <UInt32>
-TimeToRunMinute <UInt32>
-ServiceName <Uri>
[-WaitTimeBetweenFaultsSec <Int32>]
[-PartitionKindSingleton]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNamePartitionNamed
Invoke-ServiceFabricFailoverTestScenario
-MaxServiceStabilizationTimeoutSec <UInt32>
-TimeToRunMinute <UInt32>
-ServiceName <Uri>
-PartitionKey <String>
[-WaitTimeBetweenFaultsSec <Int32>]
[-PartitionKindNamed]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNamePartitionUniformedInt
Invoke-ServiceFabricFailoverTestScenario
-MaxServiceStabilizationTimeoutSec <UInt32>
-TimeToRunMinute <UInt32>
-ServiceName <Uri>
-PartitionKey <String>
[-WaitTimeBetweenFaultsSec <Int32>]
[-PartitionKindUniformInt64]
[-TimeoutSec <Int32>]
[<CommonParameters>]
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.
Examples
Example 1: Run a failover test
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
Parameters
-MaxServiceStabilizationTimeoutSec
Specifies the maximum time-out period, in seconds, for the service to stabilize before failing the test.
Parameter properties
| Type: | UInt32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PartitionId
Specifies the ID of the partition to test.
Parameter properties
| Type: | Guid |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PartitionKey
Specifies the key of the partition on which to invoke the test.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PartitionKindNamed
Indicates that this cmdlet tests a named partition.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PartitionKindSingleton
Indicates that this cmdlet tests a singleton partition.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PartitionKindUniformInt64
Indicates that this cmdlet tests a UniformInt64 partitioned service.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ServiceName
Specifies the name of the service to test.
Parameter properties
| Type: | Uri |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-TimeoutSec
Specifies the time-out period, in seconds, for the operation.
Parameter properties
| Type: | Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-TimeToRunMinute
Specifies the total time, in minutes, for the scenario to run.
Parameter properties
| Type: | UInt32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-WaitTimeBetweenFaultsSec
Specifies the maximum wait time, in seconds, between consecutive faults. The larger the value the lower the concurrency.
Parameter properties
| Type: | Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
