diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go index 2f1cd28fd4f..c569642d953 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go +++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go @@ -235,7 +235,7 @@ func (c *CRDFinalizer) deleteInstances(crd *apiextensionsv1.CustomResourceDefini // now we need to wait until all the resources are deleted. Start with a simple poll before we do anything fancy. // TODO not all servers are synchronized on caches. It is possible for a stale one to still be creating things. // Once we have a mechanism for servers to indicate their states, we should check that for concurrence. - err = wait.PollUntilContextTimeout(ctx, 1*time.Second, 1*time.Minute, true, func(ctx context.Context) (bool, error) { + err = wait.PollUntilContextTimeout(ctx, 5*time.Second, 1*time.Minute, true, func(ctx context.Context) (bool, error) { listObj, err := crClient.List(ctx, nil) if err != nil { return false, err diff --git a/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go b/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go index 85d7361f52a..6e729cc6aab 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go +++ b/staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go @@ -347,7 +347,7 @@ func existsInDiscoveryV1(crd *apiextensionsv1.CustomResourceDefinition, apiExten func waitForCRDReadyWatchUnsafe(crd *apiextensionsv1.CustomResourceDefinition, apiExtensionsClient clientset.Interface) (*apiextensionsv1.CustomResourceDefinition, error) { // wait until all resources appears in discovery for _, version := range servedV1Versions(crd) { - err := wait.PollUntilContextTimeout(context.Background(), 500*time.Second, 30*time.Second, true, func(ctx context.Context) (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, 30*time.Second, true, func(ctx context.Context) (bool, error) { return existsInDiscoveryV1(crd, apiExtensionsClient, version) }) if err != nil { @@ -396,7 +396,7 @@ func CreateNewV1CustomResourceDefinitionWatchUnsafe(v1CRD *apiextensionsv1.Custo // wait until all resources appears in discovery for _, version := range servedV1Versions(v1CRD) { - err := wait.PollUntilContextTimeout(context.Background(), 500*time.Second, 30*time.Second, true, func(ctx context.Context) (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, 30*time.Second, true, func(ctx context.Context) (bool, error) { return existsInDiscoveryV1(v1CRD, apiExtensionsClient, version) }) if err != nil { @@ -424,7 +424,7 @@ func CreateNewV1CustomResourceDefinition(v1CRD *apiextensionsv1.CustomResourceDe // For this test, we'll actually cycle, "list/watch/create/delete" until we get an RV from list that observes the create and not an error. // This way all the tests that are checking for watches don't have to worry about RV too old problems because crazy things *could* happen // before like the created RV could be too old to watch. - err = wait.PollUntilContextTimeout(context.Background(), 500*time.Second, 30*time.Second, true, func(ctx context.Context) (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, 30*time.Second, true, func(ctx context.Context) (bool, error) { return isWatchCachePrimed(v1CRD, dynamicClientSet) }) if err != nil { @@ -518,7 +518,7 @@ func DeleteV1CustomResourceDefinition(crd *apiextensionsv1.CustomResourceDefinit return err } for _, version := range servedV1Versions(crd) { - err := wait.PollUntilContextTimeout(context.Background(), 500*time.Second, 30*time.Second, true, func(ctx context.Context) (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, 30*time.Second, true, func(ctx context.Context) (bool, error) { exists, err := existsInDiscoveryV1(crd, apiExtensionsClient, version) return !exists, err }) @@ -540,7 +540,7 @@ func DeleteV1CustomResourceDefinitions(deleteListOpts metav1.ListOptions, apiExt } for _, crd := range list.Items { for _, version := range servedV1Versions(&crd) { - err := wait.PollUntilContextTimeout(context.Background(), 500*time.Second, 30*time.Second, true, func(ctx context.Context) (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, 30*time.Second, true, func(ctx context.Context) (bool, error) { exists, err := existsInDiscoveryV1(&crd, apiExtensionsClient, version) return !exists, err }) diff --git a/staging/src/k8s.io/apiextensions-apiserver/test/integration/listtype_test.go b/staging/src/k8s.io/apiextensions-apiserver/test/integration/listtype_test.go index 9e0dc864411..ddadc18ae42 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/test/integration/listtype_test.go +++ b/staging/src/k8s.io/apiextensions-apiserver/test/integration/listtype_test.go @@ -209,7 +209,7 @@ func TestListTypes(t *testing.T) { } t.Logf("Updating again with invalid values, eventually successfully due to ratcheting logic") - err = wait.PollUntilContextTimeout(context.Background(), time.Microsecond*100, wait.ForeverTestTimeout, true, func(ctx context.Context) (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Millisecond*100, wait.ForeverTestTimeout, true, func(ctx context.Context) (bool, error) { _, err = fooClient.Update(ctx, modifiedInstance, metav1.UpdateOptions{}) if err == nil { return true, err