@@ -70,6 +70,7 @@ type testSpec struct {
70
70
}
71
71
72
72
const customCAPIGroup = "custom.x-k8s.io"
73
+ const fifteenSecondDuration = time .Second * 15
73
74
74
75
func mustCreateTestController (t * testing.T , testConfigs ... * testConfig ) (* machineController , testControllerShutdownFunc ) {
75
76
t .Helper ()
@@ -444,7 +445,7 @@ func createResource(client dynamic.Interface, informer informers.GenericInformer
444
445
return err
445
446
}
446
447
447
- return wait .PollImmediateInfinite (time .Microsecond , func () (bool , error ) {
448
+ return wait .PollImmediate (time .Microsecond , fifteenSecondDuration , func () (bool , error ) {
448
449
_ , err := informer .Lister ().ByNamespace (resource .GetNamespace ()).Get (resource .GetName ())
449
450
if err != nil {
450
451
if apierrors .IsNotFound (err ) {
@@ -463,7 +464,7 @@ func updateResource(client dynamic.Interface, informer informers.GenericInformer
463
464
return err
464
465
}
465
466
466
- return wait .PollImmediateInfinite (time .Microsecond , func () (bool , error ) {
467
+ return wait .PollImmediate (time .Microsecond , fifteenSecondDuration , func () (bool , error ) {
467
468
result , err := informer .Lister ().ByNamespace (resource .GetNamespace ()).Get (resource .GetName ())
468
469
if err != nil {
469
470
return false , err
@@ -477,7 +478,7 @@ func deleteResource(client dynamic.Interface, informer informers.GenericInformer
477
478
return err
478
479
}
479
480
480
- return wait .PollImmediateInfinite (time .Microsecond , func () (bool , error ) {
481
+ return wait .PollImmediate (time .Microsecond , fifteenSecondDuration , func () (bool , error ) {
481
482
_ , err := informer .Lister ().ByNamespace (resource .GetNamespace ()).Get (resource .GetName ())
482
483
if err != nil && apierrors .IsNotFound (err ) {
483
484
return true , nil
0 commit comments