Skip to content

Commit 80ed375

Browse files
committed
Fixed time
Signed-off-by: Omer Aplatony <[email protected]>
1 parent 8b90c9e commit 80ed375

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

staging/src/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func (c *CRDFinalizer) deleteInstances(crd *apiextensionsv1.CustomResourceDefini
235235
// now we need to wait until all the resources are deleted. Start with a simple poll before we do anything fancy.
236236
// TODO not all servers are synchronized on caches. It is possible for a stale one to still be creating things.
237237
// Once we have a mechanism for servers to indicate their states, we should check that for concurrence.
238-
err = wait.PollUntilContextTimeout(ctx, 1*time.Second, 1*time.Minute, true, func(ctx context.Context) (bool, error) {
238+
err = wait.PollUntilContextTimeout(ctx, 5*time.Second, 1*time.Minute, true, func(ctx context.Context) (bool, error) {
239239
listObj, err := crClient.List(ctx, nil)
240240
if err != nil {
241241
return false, err

staging/src/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ func existsInDiscoveryV1(crd *apiextensionsv1.CustomResourceDefinition, apiExten
347347
func waitForCRDReadyWatchUnsafe(crd *apiextensionsv1.CustomResourceDefinition, apiExtensionsClient clientset.Interface) (*apiextensionsv1.CustomResourceDefinition, error) {
348348
// wait until all resources appears in discovery
349349
for _, version := range servedV1Versions(crd) {
350-
err := wait.PollUntilContextTimeout(context.Background(), 500*time.Second, 30*time.Second, true, func(ctx context.Context) (bool, error) {
350+
err := wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, 30*time.Second, true, func(ctx context.Context) (bool, error) {
351351
return existsInDiscoveryV1(crd, apiExtensionsClient, version)
352352
})
353353
if err != nil {
@@ -396,7 +396,7 @@ func CreateNewV1CustomResourceDefinitionWatchUnsafe(v1CRD *apiextensionsv1.Custo
396396

397397
// wait until all resources appears in discovery
398398
for _, version := range servedV1Versions(v1CRD) {
399-
err := wait.PollUntilContextTimeout(context.Background(), 500*time.Second, 30*time.Second, true, func(ctx context.Context) (bool, error) {
399+
err := wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, 30*time.Second, true, func(ctx context.Context) (bool, error) {
400400
return existsInDiscoveryV1(v1CRD, apiExtensionsClient, version)
401401
})
402402
if err != nil {
@@ -424,7 +424,7 @@ func CreateNewV1CustomResourceDefinition(v1CRD *apiextensionsv1.CustomResourceDe
424424
// 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.
425425
// 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
426426
// before like the created RV could be too old to watch.
427-
err = wait.PollUntilContextTimeout(context.Background(), 500*time.Second, 30*time.Second, true, func(ctx context.Context) (bool, error) {
427+
err = wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, 30*time.Second, true, func(ctx context.Context) (bool, error) {
428428
return isWatchCachePrimed(v1CRD, dynamicClientSet)
429429
})
430430
if err != nil {
@@ -518,7 +518,7 @@ func DeleteV1CustomResourceDefinition(crd *apiextensionsv1.CustomResourceDefinit
518518
return err
519519
}
520520
for _, version := range servedV1Versions(crd) {
521-
err := wait.PollUntilContextTimeout(context.Background(), 500*time.Second, 30*time.Second, true, func(ctx context.Context) (bool, error) {
521+
err := wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, 30*time.Second, true, func(ctx context.Context) (bool, error) {
522522
exists, err := existsInDiscoveryV1(crd, apiExtensionsClient, version)
523523
return !exists, err
524524
})
@@ -540,7 +540,7 @@ func DeleteV1CustomResourceDefinitions(deleteListOpts metav1.ListOptions, apiExt
540540
}
541541
for _, crd := range list.Items {
542542
for _, version := range servedV1Versions(&crd) {
543-
err := wait.PollUntilContextTimeout(context.Background(), 500*time.Second, 30*time.Second, true, func(ctx context.Context) (bool, error) {
543+
err := wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, 30*time.Second, true, func(ctx context.Context) (bool, error) {
544544
exists, err := existsInDiscoveryV1(&crd, apiExtensionsClient, version)
545545
return !exists, err
546546
})

staging/src/k8s.io/apiextensions-apiserver/test/integration/listtype_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func TestListTypes(t *testing.T) {
209209
}
210210

211211
t.Logf("Updating again with invalid values, eventually successfully due to ratcheting logic")
212-
err = wait.PollUntilContextTimeout(context.Background(), time.Microsecond*100, wait.ForeverTestTimeout, true, func(ctx context.Context) (bool, error) {
212+
err = wait.PollUntilContextTimeout(context.Background(), time.Millisecond*100, wait.ForeverTestTimeout, true, func(ctx context.Context) (bool, error) {
213213
_, err = fooClient.Update(ctx, modifiedInstance, metav1.UpdateOptions{})
214214
if err == nil {
215215
return true, err

0 commit comments

Comments
 (0)