Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into jacek/fix/security…
Browse files Browse the repository at this point in the history
…-fixes-for-gradle
  • Loading branch information
exu committed Dec 11, 2023
2 parents e9936d7 + 0c1fcb7 commit b39bb59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contrib/executor/jmeterd/pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (r *JMeterDRunner) Run(ctx context.Context, execution testkube.Execution) (
}
mode := jmeterModeStandalone
jmeterParamFlag := standaloneJMeterParamPrefix
if slavesCount > 1 {
if slavesCount > 0 {
mode = jmeterModeDistributed
jmeterParamFlag = globalJMeterParamPrefix
}
Expand Down
10 changes: 5 additions & 5 deletions contrib/executor/jmeterd/pkg/slaves/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

const (
defaultSlavesCount = 1
defaultSlavesCount = 0
serverPort = 1099
localPort = 60001
)
Expand Down Expand Up @@ -90,14 +90,14 @@ func GetSlavesCount(vars map[string]testkube.Variable) (int, error) {
return defaultSlavesCount, nil
}

replicaCount, err := strconv.Atoi(count.Value)
slavesCount, err := strconv.Atoi(count.Value)
if err != nil {
return 0, errors.Errorf("invalid SLAVES_COUNT value, expected integer, got: %v", count.Value)
}
if replicaCount < 1 {
return 0, errors.Errorf("SLAVES_COUNT must be at least 1")
if slavesCount < 0 {
return 0, errors.Errorf("SLAVES_COUNT cannot be less than 0, got: %v", count.Value)
}
return replicaCount, err
return slavesCount, err
}

func validateAndGetSlavePodName(testName string, executionId string, currentSlaveCount int) string {
Expand Down

0 comments on commit b39bb59

Please sign in to comment.