From ba0a31d224a695491b1001cca5dfe88a8dc400ab Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:45:10 +0100 Subject: [PATCH] [bugfix] fix flakey paging test (#2210) --- internal/paging/page_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/paging/page_test.go b/internal/paging/page_test.go index 01cc74d9f..9eeb90882 100644 --- a/internal/paging/page_test.go +++ b/internal/paging/page_test.go @@ -64,7 +64,7 @@ func TestPage(t *testing.T) { out := c.Page.Page(c.Input) // Log the results for case of error returns. - t.Logf("\ninput=%v\noutput=%v\nexpected=%v", c.Input, out, c.Expect) + t.Logf("%s\npage=%+v input=%v expect=%v output=%v", c.Name, c.Page, c.Input, c.Expect, out) // Check paged output is as expected. if !slices.Equal(out, c.Expect) { @@ -110,7 +110,7 @@ var cases = []Case{ // Select random parameters in slice. minIdx := randRd.Intn(len(ids)) maxIdx := randRd.Intn(len(ids)) - limit := randRd.Intn(len(ids)) + limit := randRd.Intn(len(ids)) + 1 // Select the boundaries. minID := ids[minIdx]