Skip to content

Commit

Permalink
Set GetOnFailure=true to better simulate k8s traffic
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksander Mistewicz <[email protected]>
  • Loading branch information
AwesomePatrol committed Jan 7, 2025
1 parent 1270eed commit 45b2933
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/robustness/traffic/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (t kubernetesTraffic) Write(ctx context.Context, kc kubernetes.Interface, i
return errors.New("storage empty")
}
if count > t.averageKeyCount*3/2 && nonUniqueWriteLimiter.Take() {
_, err = kc.OptimisticDelete(writeCtx, key, rev, kubernetes.DeleteOptions{})
_, err = kc.OptimisticDelete(writeCtx, key, rev, kubernetes.DeleteOptions{GetOnFailure: true})
nonUniqueWriteLimiter.Return()
} else {
shouldReturn := false
Expand All @@ -158,9 +158,9 @@ func (t kubernetesTraffic) Write(ctx context.Context, kc kubernetes.Interface, i
op := random.PickRandom(choices)
switch op {
case KubernetesDelete:
_, err = kc.OptimisticDelete(writeCtx, key, rev, kubernetes.DeleteOptions{})
_, err = kc.OptimisticDelete(writeCtx, key, rev, kubernetes.DeleteOptions{GetOnFailure: true})
case KubernetesUpdate:
_, err = kc.OptimisticPut(writeCtx, key, []byte(fmt.Sprintf("%d", ids.NewRequestID())), rev, kubernetes.PutOptions{})
_, err = kc.OptimisticPut(writeCtx, key, []byte(fmt.Sprintf("%d", ids.NewRequestID())), rev, kubernetes.PutOptions{GetOnFailure: true})
case KubernetesCreate:
_, err = kc.OptimisticPut(writeCtx, t.generateKey(), []byte(fmt.Sprintf("%d", ids.NewRequestID())), rev, kubernetes.PutOptions{})
default:
Expand Down

0 comments on commit 45b2933

Please sign in to comment.