Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Adjust machinepool helper e2e timeout #8739

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions test/framework/machinepool_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"fmt"
"strings"
"time"

"github.com/blang/semver"
. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -240,11 +241,11 @@ func WaitForMachinePoolInstancesToBeUpgraded(ctx context.Context, input WaitForM

log.Logf("Ensuring all MachinePool Instances have upgraded kubernetes version %s", input.KubernetesUpgradeVersion)
Eventually(func() (int, error) {
nn := client.ObjectKey{
mpKey := client.ObjectKey{
Namespace: input.MachinePool.Namespace,
Name: input.MachinePool.Name,
}
if err := input.Getter.Get(ctx, nn, input.MachinePool); err != nil {
if err := input.Getter.Get(ctx, mpKey, input.MachinePool); err != nil {
return 0, err
}
versions := getMachinePoolInstanceVersions(ctx, GetMachinesPoolInstancesInput{
Expand Down Expand Up @@ -286,16 +287,20 @@ func getMachinePoolInstanceVersions(ctx context.Context, input GetMachinesPoolIn
versions := make([]string, len(instances))
for i, instance := range instances {
node := &corev1.Node{}
err := wait.PollUntilContextTimeout(ctx, retryableOperationInterval, retryableOperationTimeout, true, func(ctx context.Context) (bool, error) {
err := input.WorkloadClusterGetter.Get(ctx, client.ObjectKey{Name: instance.Name}, node)
if err != nil {
var nodeGetError error
err := wait.PollUntilContextTimeout(ctx, 100*time.Millisecond, 10*time.Second, true, func(ctx context.Context) (bool, error) {
nodeGetError = input.WorkloadClusterGetter.Get(ctx, client.ObjectKey{Name: instance.Name}, node)
if nodeGetError != nil {
return false, nil //nolint:nilerr
}
return true, nil
})
if err != nil {
// Dump the instance name and error here so that we can log it as part of the version array later on.
versions[i] = fmt.Sprintf("%s error: %s", instance.Name, err)
versions[i] = "unknown"
if nodeGetError != nil {
sbueringer marked this conversation as resolved.
Show resolved Hide resolved
// Dump the instance name and error here so that we can log it as part of the version array later on.
versions[i] = fmt.Sprintf("%s error: %s", instance.Name, errors.Wrap(err, nodeGetError.Error()))
}
} else {
versions[i] = node.Status.NodeInfo.KubeletVersion
}
Expand Down