Skip to content

Commit

Permalink
Ignore ExecuteAndTimeout fault injection
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanos committed Jun 16, 2024
1 parent 7fc9c0b commit b64da39
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/persistence/client/targeted_fault_injection.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ func NewTargetedDataStoreErrorGenerator(cfg *config.FaultInjectionDataStoreConfi
methodErrRate := 0.0
for errName, errRate := range methodConfig.Errors {
err := newError(errName, errRate, methodName)
if err == nil {
continue
}
faultWeights = append(faultWeights, FaultWeight{
errFactory: func(data string) error {
return err
Expand Down Expand Up @@ -111,6 +114,8 @@ func newError(errName string, errRate float64, methodName string) error {
return fmt.Errorf("%s: %w", header, context.DeadlineExceeded)
case "Timeout":
return &persistence.TimeoutError{Msg: fmt.Sprintf("%s: persistence.TimeoutError", header)}
case "ExecuteAndTimeout":
return nil
case "ResourceExhausted":
return &serviceerror.ResourceExhausted{
Cause: enumspb.RESOURCE_EXHAUSTED_CAUSE_SYSTEM_OVERLOADED,
Expand Down

0 comments on commit b64da39

Please sign in to comment.