Skip to content

Commit

Permalink
fix: update test to reduce create fleet payload size (#7087)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschalo authored Sep 26, 2024
1 parent 8f8fafe commit d457901
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/suites/integration/termination_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var _ = Describe("Termination", func() {
env.ExpectDeleted(nodes[0])
env.EventuallyExpectNotFound(nodes[0])
Eventually(func(g Gomega) {
g.Expect(lo.FromPtr(env.GetInstanceByID(instanceID).State.Name)).To(Equal("shutting-down"))
g.Expect(lo.FromPtr(env.GetInstanceByID(instanceID).State.Name)).To(BeElementOf("shutting-down", "terminated"))
}, time.Second*10).Should(Succeed())
})
})
2 changes: 1 addition & 1 deletion test/suites/nodeclaim/garbage_collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ var _ = Describe("GarbageCollection", func() {
// Eventually expect the node and the instance to be removed (shutting-down)
env.EventuallyExpectNotFound(node)
Eventually(func(g Gomega) {
g.Expect(lo.FromPtr(env.GetInstanceByID(aws.StringValue(out.Instances[0].InstanceId)).State.Name)).To(Equal("shutting-down"))
g.Expect(lo.FromPtr(env.GetInstanceByID(aws.StringValue(out.Instances[0].InstanceId)).State.Name)).To(BeElementOf("shutting-down", "terminated"))
}, time.Second*10).Should(Succeed())
})
It("should succeed to garbage collect an Instance that was deleted without the cluster's knowledge", func() {
Expand Down
25 changes: 23 additions & 2 deletions test/suites/nodeclaim/nodeclaim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ var _ = Describe("StandaloneNodeClaim", func() {
Values: []string{"c"},
},
},
{
NodeSelectorRequirement: v1.NodeSelectorRequirement{
Key: v1.LabelArchStable,
Operator: v1.NodeSelectorOpIn,
Values: []string{"arm64"},
},
},
{
NodeSelectorRequirement: v1.NodeSelectorRequirement{
Key: corev1beta1.CapacityTypeLabelKey,
Expand Down Expand Up @@ -201,6 +208,13 @@ var _ = Describe("StandaloneNodeClaim", func() {
Values: []string{"c"},
},
},
{
NodeSelectorRequirement: v1.NodeSelectorRequirement{
Key: v1.LabelArchStable,
Operator: v1.NodeSelectorOpIn,
Values: []string{"arm64"},
},
},
{
NodeSelectorRequirement: v1.NodeSelectorRequirement{
Key: corev1beta1.CapacityTypeLabelKey,
Expand All @@ -226,7 +240,7 @@ var _ = Describe("StandaloneNodeClaim", func() {
env.EventuallyExpectNotFound(nodeClaim, node)

Eventually(func(g Gomega) {
g.Expect(lo.FromPtr(env.GetInstanceByID(instanceID).State.Name)).To(Equal("shutting-down"))
g.Expect(lo.FromPtr(env.GetInstanceByID(instanceID).State.Name)).To(BeElementOf("shutting-down", "terminated"))
}, time.Second*10).Should(Succeed())
})
It("should delete a NodeClaim from the node termination finalizer", func() {
Expand All @@ -240,6 +254,13 @@ var _ = Describe("StandaloneNodeClaim", func() {
Values: []string{"c"},
},
},
{
NodeSelectorRequirement: v1.NodeSelectorRequirement{
Key: v1.LabelArchStable,
Operator: v1.NodeSelectorOpIn,
Values: []string{"arm64"},
},
},
{
NodeSelectorRequirement: v1.NodeSelectorRequirement{
Key: corev1beta1.CapacityTypeLabelKey,
Expand All @@ -265,7 +286,7 @@ var _ = Describe("StandaloneNodeClaim", func() {
env.EventuallyExpectNotFound(nodeClaim, node)

Eventually(func(g Gomega) {
g.Expect(lo.FromPtr(env.GetInstanceByID(instanceID).State.Name)).To(Equal("shutting-down"))
g.Expect(lo.FromPtr(env.GetInstanceByID(instanceID).State.Name)).To(BeElementOf("shutting-down", "terminated"))
}, time.Second*10).Should(Succeed())
})
It("should create a NodeClaim with custom labels passed through the userData", func() {
Expand Down

0 comments on commit d457901

Please sign in to comment.