Skip to content

Commit 114c01b

Browse files
committed
storage: deflake TestEngineKeyValidate
Average the allocs across many runs to avoid flakes from a single alloc (perhaps from the runtime or testing package?). Epic: None Fixes #109919. Release note: none
1 parent bd8ee15 commit 114c01b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/storage/engine_key_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ func TestEngineKeyValidate(t *testing.T) {
288288
if err := ek.Validate(); err != nil {
289289
t.Errorf("%q.Validate() = %q, want nil", ek, err)
290290
}
291-
require.Equal(t, 0.0, testing.AllocsPerRun(1, func() {
291+
require.Equal(t, 0.0, testing.AllocsPerRun(1000, func() {
292292
_ = ek.Validate()
293293
}))
294294
}
@@ -301,7 +301,7 @@ func TestEngineKeyValidate(t *testing.T) {
301301
if err := ek.Validate(); err != nil {
302302
t.Errorf("%q.Validate() = %q, want nil", ek, err)
303303
}
304-
require.Equal(t, 0.0, testing.AllocsPerRun(1, func() {
304+
require.Equal(t, 0.0, testing.AllocsPerRun(1000, func() {
305305
_ = ek.Validate()
306306
}))
307307
buf = ek.Key[:0]

0 commit comments

Comments
 (0)