From e1b4580775761429398e9abab43fb75850875ee6 Mon Sep 17 00:00:00 2001 From: Derek Wang Date: Wed, 24 Mar 2021 15:11:05 -0700 Subject: [PATCH] fix(stress-testing): only check total requests when it is specified (#1135) Signed-off-by: Derek Wang --- test/stress/generator/cmd/root.go | 6 ++++-- test/stress/testdata/sensors/log.yaml | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/test/stress/generator/cmd/root.go b/test/stress/generator/cmd/root.go index 5b17aed6c5..0f5fb72dd9 100644 --- a/test/stress/generator/cmd/root.go +++ b/test/stress/generator/cmd/root.go @@ -13,6 +13,8 @@ import ( const ( Success = "success" Failure = "failure" + + RootCommand = "go run ./test/stress/generator/main.go" ) var ( @@ -22,7 +24,7 @@ var ( ) var rootCmd = &cobra.Command{ - Use: "go run ./test/stress/generator/main.go", + Use: RootCommand, Short: "Events generator for stress testing.", Long: ``, Run: func(cmd *cobra.Command, args []string) { @@ -100,7 +102,7 @@ loop: } }() counter++ - if counter >= totalRequests { + if totalRequests > 0 && counter >= totalRequests { break loop } } diff --git a/test/stress/testdata/sensors/log.yaml b/test/stress/testdata/sensors/log.yaml index a8ff4044cd..4ac36242e9 100644 --- a/test/stress/testdata/sensors/log.yaml +++ b/test/stress/testdata/sensors/log.yaml @@ -3,6 +3,15 @@ kind: Sensor metadata: name: stress-testing-log spec: + # template: + # container: + # resources: + # requests: + # memory: "64Mi" + # cpu: "250m" + # limits: + # memory: "128Mi" + # cpu: "500m" dependencies: - name: dep eventSourceName: stress-testing