Skip to content

Commit c536135

Browse files
authored
reset stderr between benchmark runs (#612)
otherwise it will grow without bound.
1 parent a0a5475 commit c536135

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/endtoend/endtoend_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ func BenchmarkExamples(b *testing.B) {
6060
tc := replay.Name()
6161
b.Run(tc, func(b *testing.B) {
6262
path := filepath.Join(examples, tc)
63-
var stderr bytes.Buffer
6463
for i := 0; i < b.N; i++ {
64+
var stderr bytes.Buffer
6565
cmd.Generate(cmd.Env{}, path, &stderr)
6666
}
6767
})
@@ -183,8 +183,8 @@ func BenchmarkReplay(b *testing.B) {
183183
tc := replay
184184
b.Run(tc, func(b *testing.B) {
185185
path, _ := filepath.Abs(tc)
186-
var stderr bytes.Buffer
187186
for i := 0; i < b.N; i++ {
187+
var stderr bytes.Buffer
188188
cmd.Generate(cmd.Env{}, path, &stderr)
189189
}
190190
})

0 commit comments

Comments
 (0)