Make API chunking conformance test deterministic

This commit is contained in:
Wojciech Tyczyński 2023-08-23 12:18:23 +02:00
parent 4e2e059c7b
commit f752ca2dc8

View File

@ -19,7 +19,6 @@ package apimachinery
import (
"context"
"fmt"
"math/rand"
"reflect"
"time"
@ -80,7 +79,9 @@ var _ = SIGDescribe("Servers with support for API chunking", func() {
found := 0
var lastRV string
for {
opts.Limit = int64(rand.Int31n(numberOfTotalResources/10) + 1)
// With numberOfTotalResources=400, we want to ensure that both
// number of items per page and number of pages are non-trivial.
opts.Limit = 17
list, err := client.List(ctx, opts)
framework.ExpectNoError(err, "failed to list pod templates in namespace: %s, given limit: %d", ns, opts.Limit)
framework.Logf("Retrieved %d/%d results with rv %s and continue %s", len(list.Items), opts.Limit, list.ResourceVersion, list.Continue)