Skip to content

Commit

Permalink
fix: test values adjusted
Browse files Browse the repository at this point in the history
  • Loading branch information
lukher-dev committed Nov 21, 2021
1 parent 7ef3e7b commit 50e6506
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gocannon.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ func NewGocannon(cfg common.Config) (Gocannon, error) {
func (g Gocannon) Run() (TestResults, error) {

n := *g.cfg.Connections
runtime.GOMAXPROCS(*g.cfg.CPUs)

if g.cfg.CPUs != nil {
runtime.GOMAXPROCS(*g.cfg.CPUs)
}

var wg sync.WaitGroup

Expand Down
5 changes: 5 additions & 0 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"math"
"os/exec"
"runtime"
"sync"
"sync/atomic"
"testing"
Expand Down Expand Up @@ -96,6 +97,7 @@ func TestGocannon(t *testing.T) {
func TestGocannonDefaultValues(t *testing.T) {
duration := time.Second * 1
connections := 50
cpus := runtime.NumCPU()
timeout := time.Millisecond * 200
mode := "reqlog"
outputFile := ""
Expand All @@ -112,6 +114,7 @@ func TestGocannonDefaultValues(t *testing.T) {
cfg := common.Config{
Duration: &duration,
Connections: &connections,
CPUs: &cpus,
Timeout: &timeout,
Mode: &mode,
OutputFile: &outputFile,
Expand Down Expand Up @@ -145,6 +148,7 @@ func TestGocanonWithPlugin(t *testing.T) {

duration := time.Second * 1
connections := 50
cpus := runtime.NumCPU()
timeout := time.Millisecond * 200
mode := "hist"
outputFile := ""
Expand All @@ -161,6 +165,7 @@ func TestGocanonWithPlugin(t *testing.T) {
cfg := common.Config{
Duration: &duration,
Connections: &connections,
CPUs: &cpus,
Timeout: &timeout,
Mode: &mode,
OutputFile: &outputFile,
Expand Down

0 comments on commit 50e6506

Please sign in to comment.