diff --git a/cmd/integration-test/http.go b/cmd/integration-test/http.go index be75506cb..f0e5d1ae2 100644 --- a/cmd/integration-test/http.go +++ b/cmd/integration-test/http.go @@ -829,10 +829,7 @@ func (h *httpPaths) Execute(filepath string) error { } if len(expected) > len(actual) { - actualValuesIndex := len(actual) - 1 - if actualValuesIndex < 0 { - actualValuesIndex = 0 - } + actualValuesIndex := max(len(actual)-1, 0) return fmt.Errorf("missing values : %v", expected[actualValuesIndex:]) } else if len(expected) < len(actual) { return fmt.Errorf("unexpected values : %v", actual[len(expected)-1:]) diff --git a/pkg/protocols/http/request.go b/pkg/protocols/http/request.go index 14599f690..f401fe4cf 100644 --- a/pkg/protocols/http/request.go +++ b/pkg/protocols/http/request.go @@ -336,11 +336,8 @@ func (request *Request) executeTurboHTTP(input *contextargs.Context, dynamicValu pipeClient := rawhttp.NewPipelineClient(pipeOptions) // defaultMaxWorkers should be a sufficient value to keep queues always full - maxWorkers := defaultMaxWorkers // in case the queue is bigger increase the workers - if pipeOptions.MaxPendingRequests > maxWorkers { - maxWorkers = pipeOptions.MaxPendingRequests - } + maxWorkers := max(pipeOptions.MaxPendingRequests, defaultMaxWorkers) // Stop-at-first-match logic while executing requests // parallely using threads