Skip to content

Commit 1f69d07

Browse files
authored
Merge pull request #8739 from killianmuldoon/pr-mp-helper-timeout
🐛 Adjust machinepool helper e2e timeout
2 parents 89a36ac + a26fe0e commit 1f69d07

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

test/framework/machinepool_helpers.go

+12-7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"context"
2121
"fmt"
2222
"strings"
23+
"time"
2324

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

241242
log.Logf("Ensuring all MachinePool Instances have upgraded kubernetes version %s", input.KubernetesUpgradeVersion)
242243
Eventually(func() (int, error) {
243-
nn := client.ObjectKey{
244+
mpKey := client.ObjectKey{
244245
Namespace: input.MachinePool.Namespace,
245246
Name: input.MachinePool.Name,
246247
}
247-
if err := input.Getter.Get(ctx, nn, input.MachinePool); err != nil {
248+
if err := input.Getter.Get(ctx, mpKey, input.MachinePool); err != nil {
248249
return 0, err
249250
}
250251
versions := getMachinePoolInstanceVersions(ctx, GetMachinesPoolInstancesInput{
@@ -286,16 +287,20 @@ func getMachinePoolInstanceVersions(ctx context.Context, input GetMachinesPoolIn
286287
versions := make([]string, len(instances))
287288
for i, instance := range instances {
288289
node := &corev1.Node{}
289-
err := wait.PollUntilContextTimeout(ctx, retryableOperationInterval, retryableOperationTimeout, true, func(ctx context.Context) (bool, error) {
290-
err := input.WorkloadClusterGetter.Get(ctx, client.ObjectKey{Name: instance.Name}, node)
291-
if err != nil {
290+
var nodeGetError error
291+
err := wait.PollUntilContextTimeout(ctx, 100*time.Millisecond, 10*time.Second, true, func(ctx context.Context) (bool, error) {
292+
nodeGetError = input.WorkloadClusterGetter.Get(ctx, client.ObjectKey{Name: instance.Name}, node)
293+
if nodeGetError != nil {
292294
return false, nil //nolint:nilerr
293295
}
294296
return true, nil
295297
})
296298
if err != nil {
297-
// Dump the instance name and error here so that we can log it as part of the version array later on.
298-
versions[i] = fmt.Sprintf("%s error: %s", instance.Name, err)
299+
versions[i] = "unknown"
300+
if nodeGetError != nil {
301+
// Dump the instance name and error here so that we can log it as part of the version array later on.
302+
versions[i] = fmt.Sprintf("%s error: %s", instance.Name, errors.Wrap(err, nodeGetError.Error()))
303+
}
299304
} else {
300305
versions[i] = node.Status.NodeInfo.KubeletVersion
301306
}

0 commit comments

Comments
 (0)