Skip to content

Commit

Permalink
wording changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdeal committed May 10, 2024
1 parent fe5ee88 commit 8624b23
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/suites/drift/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ var _ = Describe("Drift", func() {
env.ConsistentlyExpectNodeClaimsNotDrifted(time.Minute, nodeClaim)
})
Context("Failure", func() {
It("should not continue to drift if a node never registers", func() {
It("should not disrupt a drifted node if the replacement node never registers", func() {
// launch a new nodeClaim
var numPods int32 = 2
dep := coretest.Deployment(coretest.DeploymentOptions{
Expand Down Expand Up @@ -845,15 +845,17 @@ var _ = Describe("Drift", func() {
// TODO: reduce timeouts when disruption waits are factored out
env.EventuallyExpectNodesUntaintedWithTimeout(11*time.Minute, taintedNodes...)

// Expect all the NodeClaims that existed on the initial provisioning loop are not removed
// Expect all the NodeClaims that existed on the initial provisioning loop are not removed.
// Assert this over several minutes to ensure a subsequent disruption controller pass doesn't
// successfully schedule the evicted pods to the in-flight nodeclaim and disrupt the original node
Consistently(func(g Gomega) {
nodeClaims := env.ExpectNodeClaimCount(">=", int(numPods))
startingNodeClaimUIDs := sets.New(lo.Map(startingNodeClaimState, func(nc *corev1beta1.NodeClaim, _ int) types.UID { return nc.UID })...)
nodeClaimUIDs := sets.New(lo.Map(nodeClaims, func(nc *corev1beta1.NodeClaim, _ int) types.UID { return nc.UID })...)
g.Expect(nodeClaimUIDs.IsSuperset(startingNodeClaimUIDs)).To(BeTrue())
}, "2m").Should(Succeed())
})
It("should not continue to drift if a node registers but never becomes initialized", func() {
It("should not disrupt a drifted node if the replacement node registers but never initialized", func() {
// launch a new nodeClaim
var numPods int32 = 2
dep := coretest.Deployment(coretest.DeploymentOptions{
Expand All @@ -879,7 +881,7 @@ var _ = Describe("Drift", func() {

env.EventuallyExpectDrifted(startingNodeClaimState...)

// Expect nodes to be tainted
// Expect nodes To get tainted, expect only one node is disrupted due to default disruption budgets
taintedNodes := env.EventuallyExpectTaintedNodeCount("==", 1)

// Drift should fail and original node should be untainted
Expand All @@ -896,6 +898,8 @@ var _ = Describe("Drift", func() {
Expect(nodeClaimList.Items).To(HaveLen(int(numPods) + 1))

// Expect all the NodeClaims that existed on the initial provisioning loop are not removed
// Assert this over several minutes to ensure a subsequent disruption controller pass doesn't
// successfully schedule the evicted pods to the in-flight nodeclaim and disrupt the original node
Consistently(func(g Gomega) {
nodeClaims := env.ExpectNodeClaimCount(">=", int(numPods))
startingNodeClaimUIDs := sets.New(lo.Map(startingNodeClaimState, func(m *corev1beta1.NodeClaim, _ int) types.UID { return m.UID })...)
Expand Down

0 comments on commit 8624b23

Please sign in to comment.