Skip to content

Commit

Permalink
fix(stress-testing): only check total requests when it is specified (#…
Browse files Browse the repository at this point in the history
…1135)

Signed-off-by: Derek Wang <whynowy@gmail.com>
  • Loading branch information
whynowy committed Mar 24, 2021
1 parent 3a2581d commit 21bc5bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/stress/generator/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
const (
Success = "success"
Failure = "failure"

RootCommand = "go run ./test/stress/generator/main.go"
)

var (
Expand All @@ -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) {
Expand Down Expand Up @@ -100,7 +102,7 @@ loop:
}
}()
counter++
if counter >= totalRequests {
if totalRequests > 0 && counter >= totalRequests {
break loop
}
}
Expand Down
9 changes: 9 additions & 0 deletions test/stress/testdata/sensors/log.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 21bc5bf

Please sign in to comment.