From c15a868ea5247e4cb47d97015bb1a8974f973a74 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 22 Mar 2022 11:58:37 +0000 Subject: [PATCH] kv/bulk: fix kvBuf test x 'fits' in y if less than _or equal_, not just less; the code had this right but the test did not. Release note: none. --- pkg/kv/bulk/kv_buf_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kv/bulk/kv_buf_test.go b/pkg/kv/bulk/kv_buf_test.go index 2ba1dae27ed7..06ac4d486a16 100644 --- a/pkg/kv/bulk/kv_buf_test.go +++ b/pkg/kv/bulk/kv_buf_test.go @@ -63,7 +63,7 @@ func TestKvBuf(t *testing.T) { b := kvBuf{} for i := range src { size := sz(len(src[i].key) + len(src[i].value)) - fits := len(b.entries) < cap(b.entries) && len(b.slab)+int(size) < cap(b.slab) + fits := len(b.entries) <= cap(b.entries) && len(b.slab)+int(size) <= cap(b.slab) require.Equal(t, fits, b.fits(ctx, size, 0, &none)) if !fits {