Giter VIP home page Giter VIP logo

Comments (12)

serathius avatar serathius commented on July 18, 2024 1

Bisected this to a8ef6e9
cc @wojtek-t

from kubernetes.

chaochn47 avatar chaochn47 commented on July 18, 2024 1

I'm not sure if this is the proper way to fix it, but setting a limit in the ListOptions deflakes the test.

Right, setting a limit when a resource version is set would delegate the list to etcd when cache is not initialized based on the KEP description.

It is due to this type of request is not that costly to etcd.

Perhaps in tests we could wait till the cache is ready in order to proceed?

Looks like it is exactly how the wait cache ready is added in https://github.com/kubernetes/kubernetes/pull/124642/files#diff-d82df65cc0625a3f621333245e76fbc801b579eedd3d266fe36eeb99366b5680.

See below

if utilfeature.DefaultFeatureGate.Enabled(features.ResilientWatchCacheInitialization) {
// The tests assume that Get/GetList/Watch calls shouldn't fail.
// However, 429 error can now be returned if watchcache is under initialization.
// To avoid rewriting all tests, we wait for watcache to initialize.
if err := cacher.ready.wait(ctx); err != nil {
t.Fatal(err)
}
}

So I think we should implement this same thing in newTestGenericStoreRegistry when initializing the cacher.

from kubernetes.

wojtek-t avatar wojtek-t commented on July 18, 2024 1

Agree - waiting for cacher to be initialized when creating it here is a better fix for it:
https://github.com/kubernetes/kubernetes/blob/22512e7a3c6db15ac7a9d46edfe4563fe561418f/staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store_test.go#L2448C4-L2449C1

from kubernetes.

wojtek-t avatar wojtek-t commented on July 18, 2024 1

Exposing Wait(context) method sounds fine

from kubernetes.

k8s-ci-robot avatar k8s-ci-robot commented on July 18, 2024

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

from kubernetes.

neolit123 avatar neolit123 commented on July 18, 2024

func TestStoreListResourceVersion(t *testing.T) {

/sig api-machinery

from kubernetes.

BenTheElder avatar BenTheElder commented on July 18, 2024

See also https://testgrid.k8s.io/sig-release-master-blocking#ci-kubernetes-unit

https://go.k8s.io/triage?pr=1&test=k8s.io%2Fapiserver%2Fpkg%2Fregistry%2Fgeneric

from kubernetes.

logicalhan avatar logicalhan commented on July 18, 2024

/sig etcd

from kubernetes.

fedebongio avatar fedebongio commented on July 18, 2024

/assign @serathius
/cc @wenjiaswe

from kubernetes.

mauri870 avatar mauri870 commented on July 18, 2024

I'm not sure if this is the proper way to fix it, but setting a limit in the ListOptions deflakes the test.

The flakiness comes from the fact that the cache is sometimes not initialized in time which causes it to return a "too many requests".

Perhaps in tests we could wait till the cache is ready in order to proceed?

from kubernetes.

mauri870 avatar mauri870 commented on July 18, 2024

I thought about this as well, but waiting on cacher.ready.wait() is not possible outside of the cacher module, since it is a private field.

I'm thinking to either add an option WaitUntilReady to cacherstorage.Config and make cacherstorage.NewCacherFromConfig wait or add a new public method Wait(context.Context) error to Cacher.

Do you guys have a better idea? Thanks.

from kubernetes.

mauri870 avatar mauri870 commented on July 18, 2024

I have pushed the changes we discussed. Thank you all for your guidance.

from kubernetes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.