private static InjectBehaviourPolicy CreateRetryChaos(IPolicies policies) { return(MonkeyPolicy.InjectBehaviour((context) => throw new SqliteException( "Policy chaos testing", Convert.ToInt32(ChaosPolicyShared.GetRandomEnum <RetryableSqlErrors>())), (context) => ChaosPolicyShared.InjectionRate(context, RetryConstants.RetryCount, RetryAttempts), (context) => policies.EnableChaos)); }
private static InjectOutcomePolicy CreateRetryChaos(IPolicies policies) { return(MonkeyPolicy.InjectException(with => with.Fault(Behaviour()) .InjectionRate((context, token) => ChaosPolicyShared.InjectionRate(context, RetryConstants.RetryCount, RetryAttempts)) .Enabled(policies.EnableChaos) )); }
private static InjectBehaviourPolicy CreateRetryChaos(IPolicies policies) { return(MonkeyPolicy.InjectBehaviour( (context) => throw new PostgresException { SqlState = ChaosPolicyShared.GetRandomString(RetryablePostGreErrors.Errors.ToList()) }, (context) => ChaosPolicyShared.InjectionRate(context, RetryConstants.RetryCount, RetryAttempts), (context) => policies.EnableChaos)); }
private static InjectOutcomePolicy CreateRetryChaos(IPolicies policies) { var fault = new PostgresException(string.Empty, string.Empty, string.Empty, ChaosPolicyShared.GetRandomString(RetryablePostGreErrors.Errors.ToList())); return(MonkeyPolicy.InjectException(with => with.Fault(fault) .InjectionRate((context, token) => ChaosPolicyShared.InjectionRate(context, RetryConstants.RetryCount, RetryAttempts)) .Enabled(policies.EnableChaos) )); }
private static InjectOutcomePolicy CreateRetryChaos(IPolicies policies) { var fault = new SQLiteException( (SQLiteErrorCode)ChaosPolicyShared.GetRandomEnum <RetryableSqlErrors>(), "Policy chaos testing"); return(MonkeyPolicy.InjectException(with => with.Fault(fault) .InjectionRate((context, token) => ChaosPolicyShared.InjectionRate(context, RetryConstants.RetryCount, RetryAttempts)) .Enabled(policies.EnableChaos) )); }
private static InjectBehaviourPolicy CreateRetryChaos(IPolicies policies) { return(MonkeyPolicy.InjectBehaviour(Behaviour, (context) => ChaosPolicyShared.InjectionRate(context, RetryConstants.RetryCount, RetryAttempts), (context) => policies.EnableChaos)); }