Skip to content

Commit

Permalink
Merge pull request #2160 from jackfrancis/disable-flaky-drain-tests
Browse files Browse the repository at this point in the history
E2E: disable flaky machinepoolmachine drain test
  • Loading branch information
k8s-ci-robot authored Mar 10, 2022
2 parents 29976f8 + c2781f0 commit c3d1ef1
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions test/e2e/azure_machinepool_drain.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import (
clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1"
"sigs.k8s.io/cluster-api/test/framework"
"sigs.k8s.io/cluster-api/util"
"sigs.k8s.io/cluster-api/util/conditions"
"sigs.k8s.io/cluster-api/util/patch"
"sigs.k8s.io/controller-runtime/pkg/client"
)
Expand Down Expand Up @@ -167,24 +166,9 @@ func testMachinePoolCordonAndDrain(ctx context.Context, mgmtClusterProxy, worklo
return helper.Patch(ctx, owningMachinePool)
}, 3*time.Minute, 3*time.Second).Should(Succeed())

By(fmt.Sprintf("checking for a machine to start draining for machine pool: %s/%s", amp.Namespace, amp.Name))
Eventually(func() error {
ampmls, err := getAzureMachinePoolMachines(ctx, mgmtClusterProxy, workloadClusterProxy, amp)
if err != nil {
LogWarning(errors.Wrap(err, "failed to list the azure machine pool machines").Error())
return err
}

for _, machine := range ampmls {
if conditions.Has(&machine, clusterv1.DrainingSucceededCondition) && conditions.IsFalse(&machine, clusterv1.DrainingSucceededCondition) {
return nil // started draining the node prior to delete
}
}

return errors.New("no machine has started to drain")
}, waitForDrainOperationTimeout, waitForDrainSleepBetweenRetries).Should(Succeed())
// TODO setup a watcher to validate expected 2nd order drain outcomes
// https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/2159

// TODO setup a watcher to detect the terminal drain success state
}

func labelNodesWithMachinePoolName(ctx context.Context, workloadClient client.Client, mpName string, ampms []infrav1exp.AzureMachinePoolMachine) {
Expand Down

0 comments on commit c3d1ef1

Please sign in to comment.