diff --git a/pkg/loadtester/task_ngrinder.go b/pkg/loadtester/task_ngrinder.go index f090f971c..4a4dca15e 100644 --- a/pkg/loadtester/task_ngrinder.go +++ b/pkg/loadtester/task_ngrinder.go @@ -39,14 +39,14 @@ func init() { if err != nil { return nil, errors.New("metadata auth provided is invalid, base64 encoded username:password required") } - interval, err := strconv.Atoi(pollInterval) + interval, err := time.ParseDuration(pollInterval) if err != nil { interval = 1 } return &NGrinderTask{ TaskBase{canary, logger}, - baseUrl, cloneId, username, string(passwdDecoded), -1, time.Duration(interval), + baseUrl, cloneId, username, string(passwdDecoded), -1, interval, }, nil }) } diff --git a/pkg/loadtester/task_ngrinder_test.go b/pkg/loadtester/task_ngrinder_test.go index eae2f66e0..8d8aa3231 100644 --- a/pkg/loadtester/task_ngrinder_test.go +++ b/pkg/loadtester/task_ngrinder_test.go @@ -33,7 +33,7 @@ func TestTaskNGrinder(t *testing.T) { "clone": cloneId, "username": "admin", "passwd": "YWRtaW4=", - "pollInterval": "1", + "pollInterval": "1s", }, canary, logger) if err != nil { t.Fatalf("Failed to create ngrinder task: %s", err.Error())