Skip to content

Commit ef36c36

Browse files
dheerajodhaclaude
andcommitted
fix(EC-1816): validate envInt returns positive value
Reject zero and negative values for EC_STRESS_COMPONENTS and EC_STRESS_WORKERS to fail fast instead of producing meaningless benchmark results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c555ff0 commit ef36c36

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

benchmark/stress/stress.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ func envInt(name string, fallback int) int {
5555
if err != nil {
5656
panic(fmt.Sprintf("invalid %s value %q: %v", name, v, err))
5757
}
58+
if n < 1 {
59+
panic(fmt.Sprintf("%s must be >= 1, got %d", name, n))
60+
}
5861
return n
5962
}
6063

0 commit comments

Comments
 (0)