Skip to content

Commit

Permalink
Reduce polling interval for check
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis committed Jan 31, 2024
1 parent bff5f05 commit 57bcd2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/envtest/server.go
Expand Up @@ -334,12 +334,13 @@ func (te *Environment) startControlPlane() error {
}

func (te *Environment) waitForDefaultNamespace(config *rest.Config) error {
fmt.Println("waiting...")
cs, err := client.New(config, client.Options{})
if err != nil {
return fmt.Errorf("unable to create client: %w", err)
}
// It shouldn't take longer than 5s for the default namespace to be brought up in etcd
return wait.PollUntilContextTimeout(context.TODO(), time.Millisecond*500, time.Second*5, true, func(ctx context.Context) (bool, error) {
return wait.PollUntilContextTimeout(context.TODO(), time.Millisecond*50, time.Second*5, true, func(ctx context.Context) (bool, error) {
if err = cs.Get(ctx, types.NamespacedName{Name: "default"}, &corev1.Namespace{}); err != nil {
return false, nil //nolint:nilerr
}
Expand Down

0 comments on commit 57bcd2d

Please sign in to comment.