diff --git a/scenarios/throughput_stress.go b/scenarios/throughput_stress.go index 848668a..96b741e 100644 --- a/scenarios/throughput_stress.go +++ b/scenarios/throughput_stress.go @@ -43,14 +43,16 @@ func (t *tpsExecutor) Run(ctx context.Context, info loadgen.ScenarioInfo) error var deniedErr *serviceerror.PermissionDenied var alreadyErr *serviceerror.AlreadyExists - if errors.As(err, &deniedErr) { + if errors.As(err, &alreadyErr) { + info.Logger.Infof("Search Attribute %s already exists", ThroughputStressScenarioIdSearchAttribute) + } else if err != nil { info.Logger.Warnf("Failed to add Search Attribute %s: %v", ThroughputStressScenarioIdSearchAttribute, err) - } else if !errors.As(err, &alreadyErr) { - info.Logger.Info("Search Attribute %s already exists", ThroughputStressScenarioIdSearchAttribute) - return err + if !errors.As(err, &deniedErr) { + return err + } } else { - info.Logger.Info("Search Attribute %s added", ThroughputStressScenarioIdSearchAttribute) + info.Logger.Infof("Search Attribute %s added", ThroughputStressScenarioIdSearchAttribute) } // Complain if there are already existing workflows with the provided run id