mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-16 15:20:17 +00:00
Make API chunking conformance test deterministic
This commit is contained in:
parent
4e2e059c7b
commit
f752ca2dc8
@ -19,7 +19,6 @@ package apimachinery
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -80,7 +79,9 @@ var _ = SIGDescribe("Servers with support for API chunking", func() {
|
|||||||
found := 0
|
found := 0
|
||||||
var lastRV string
|
var lastRV string
|
||||||
for {
|
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)
|
list, err := client.List(ctx, opts)
|
||||||
framework.ExpectNoError(err, "failed to list pod templates in namespace: %s, given limit: %d", ns, opts.Limit)
|
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)
|
framework.Logf("Retrieved %d/%d results with rv %s and continue %s", len(list.Items), opts.Limit, list.ResourceVersion, list.Continue)
|
||||||
|
Loading…
Reference in New Issue
Block a user