From 45b293313eeb0dbb081b36238debab91ed3b01c5 Mon Sep 17 00:00:00 2001 From: Aleksander Mistewicz Date: Tue, 7 Jan 2025 16:49:08 +0100 Subject: [PATCH] Set GetOnFailure=true to better simulate k8s traffic Signed-off-by: Aleksander Mistewicz --- tests/robustness/traffic/kubernetes.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/robustness/traffic/kubernetes.go b/tests/robustness/traffic/kubernetes.go index 487fc0e3b2a..aadeefc6f79 100644 --- a/tests/robustness/traffic/kubernetes.go +++ b/tests/robustness/traffic/kubernetes.go @@ -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 @@ -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: