mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 21:36:24 +00:00
Fixed time
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
This commit is contained in:
parent
8b90c9e885
commit
80ed375e37
@ -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.
|
// 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.
|
// 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.
|
// 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)
|
listObj, err := crClient.List(ctx, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
|
@ -347,7 +347,7 @@ func existsInDiscoveryV1(crd *apiextensionsv1.CustomResourceDefinition, apiExten
|
|||||||
func waitForCRDReadyWatchUnsafe(crd *apiextensionsv1.CustomResourceDefinition, apiExtensionsClient clientset.Interface) (*apiextensionsv1.CustomResourceDefinition, error) {
|
func waitForCRDReadyWatchUnsafe(crd *apiextensionsv1.CustomResourceDefinition, apiExtensionsClient clientset.Interface) (*apiextensionsv1.CustomResourceDefinition, error) {
|
||||||
// wait until all resources appears in discovery
|
// wait until all resources appears in discovery
|
||||||
for _, version := range servedV1Versions(crd) {
|
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)
|
return existsInDiscoveryV1(crd, apiExtensionsClient, version)
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -396,7 +396,7 @@ func CreateNewV1CustomResourceDefinitionWatchUnsafe(v1CRD *apiextensionsv1.Custo
|
|||||||
|
|
||||||
// wait until all resources appears in discovery
|
// wait until all resources appears in discovery
|
||||||
for _, version := range servedV1Versions(v1CRD) {
|
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)
|
return existsInDiscoveryV1(v1CRD, apiExtensionsClient, version)
|
||||||
})
|
})
|
||||||
if err != nil {
|
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.
|
// 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
|
// 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.
|
// 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)
|
return isWatchCachePrimed(v1CRD, dynamicClientSet)
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -518,7 +518,7 @@ func DeleteV1CustomResourceDefinition(crd *apiextensionsv1.CustomResourceDefinit
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, version := range servedV1Versions(crd) {
|
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)
|
exists, err := existsInDiscoveryV1(crd, apiExtensionsClient, version)
|
||||||
return !exists, err
|
return !exists, err
|
||||||
})
|
})
|
||||||
@ -540,7 +540,7 @@ func DeleteV1CustomResourceDefinitions(deleteListOpts metav1.ListOptions, apiExt
|
|||||||
}
|
}
|
||||||
for _, crd := range list.Items {
|
for _, crd := range list.Items {
|
||||||
for _, version := range servedV1Versions(&crd) {
|
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)
|
exists, err := existsInDiscoveryV1(&crd, apiExtensionsClient, version)
|
||||||
return !exists, err
|
return !exists, err
|
||||||
})
|
})
|
||||||
|
@ -209,7 +209,7 @@ func TestListTypes(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
t.Logf("Updating again with invalid values, eventually successfully due to ratcheting logic")
|
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{})
|
_, err = fooClient.Update(ctx, modifiedInstance, metav1.UpdateOptions{})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return true, err
|
return true, err
|
||||||
|
Loading…
Reference in New Issue
Block a user